securityfs: securityfs_remove should handle IS_ERR pointers
authorEric Paris <eparis@redhat.com>
Tue, 12 May 2009 00:47:15 +0000 (20:47 -0400)
committerJames Morris <jmorris@namei.org>
Tue, 12 May 2009 01:06:11 +0000 (11:06 +1000)
Both of the securityfs users (TPM and IMA) can call securityfs_remove and pass
an IS_ERR(dentry) in their failure paths.  This patch handles those rather
than panicing when it tries to start deferencing some negative memory.

Signed-off-by: Eric Paris <eparis@redhat.com>
Signed-off-by: James Morris <jmorris@namei.org>
security/inode.c

index f3b91bfbe4cb9483ea55e7e64c5c1c52b8c71d0d..f7496c6a022b7c2213f061c17b435bf0328085ed 100644 (file)
@@ -287,7 +287,7 @@ void securityfs_remove(struct dentry *dentry)
 {
        struct dentry *parent;
 
-       if (!dentry)
+       if (!dentry || IS_ERR(dentry))
                return;
 
        parent = dentry->d_parent;
This page took 0.030246 seconds and 5 git commands to generate.