Skip to contentSkip to conversation

nfs: avoid dereferencing null pointer in initiate_bulk_draining

PATCH Myklebust, Trond 1 participant 1 message Jan 5, 2013 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 13 lines · Nickolai Zeldovich

Fix an inverted null pointer check in initiate_bulk_draining().

---
 fs/nfs/callback_proc.c |    2 +--
 1 file changed, 1 insertion(+-), 1 deletion(-)
fs/nfs/callback_proc.c +1 -1
index c89b26b..264d1aa 100644
--- a/fs/nfs/callback_proc.c
+-+-+- b/fs/nfs/callback_proc.c

@@ -206,7 +-206,7 @@ static u32 initiate_bulk_draining(struct nfs_client *clp,

fs/nfs/callback_proc.c

Quoted 7 lines
fs/nfs/callback_proc.c +1 -1
 		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? */

Thanks for spotting. Applied to the 'bugfixes' branch.

Signature · 6 lines
Trond Myklebust
Linux NFS client maintainer

NetApp
[email protected]
www.netapp.com