nfs: avoid dereferencing null pointer in initiate_bulk_draining
authorNickolai Zeldovich <nickolai@csail.mit.edu>
Sat, 5 Jan 2013 19:19:51 +0000 (14:19 -0500)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Sat, 5 Jan 2013 19:26:51 +0000 (14:26 -0500)
Fix an inverted null pointer check in initiate_bulk_draining().

Signed-off-by: Nickolai Zeldovich <nickolai@csail.mit.edu>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: stable@vger.kernel.org [>= 3.7]
fs/nfs/callback_proc.c

index c89b26bc9759251ab370da28eab07a266adbd573..264d1aa935f2b3e52e3e08bd26ee99c30912c8f6 100644 (file)
@@ -206,7 +206,7 @@ static u32 initiate_bulk_draining(struct nfs_client *clp,
 
                list_for_each_entry(lo, &server->layouts, plh_layouts) {
                        ino = igrab(lo->plh_inode);
-                       if (ino)
+                       if (!ino)
                                continue;
                        spin_lock(&ino->i_lock);
                        /* Is this layout in the process of being freed? */