Skip to contentSkip to conversation

dereferencing ERR_PTR()

PATCH New Dan Carpenter 1 participant 1 message Nov 11, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dereferencing ERR_PTR()

It's possible for __rpc_lookup_create() to return ERR_PTR(-ENOMEM).

Found by smatch static checker.

regards,
dan carpenter

net/sunrpc/rpc_pipe.c +2 -0
@@ -587,6 +587,8 @@
 	struct dentry *dentry;
 
 	dentry = __rpc_lookup_create(parent, name);
+	if (IS_ERR(dentry))
+		return dentry;
 	if (dentry->d_inode == NULL)
 		return dentry;
 	dput(dentry);