diff options
author | Eric Paris <eparis@redhat.com> | 2009-05-12 02:47:15 +0200 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2009-05-12 03:06:11 +0200 |
commit | d93e4c940f51ae06b59c14523c4d55947f9597d6 (patch) | |
tree | 2dfe72da55eab4bd12e059f7d9de6f9c37eedbbf /security/inode.c | |
parent | IMA: open all files O_LARGEFILE (diff) | |
download | linux-d93e4c940f51ae06b59c14523c4d55947f9597d6.tar.xz linux-d93e4c940f51ae06b59c14523c4d55947f9597d6.zip |
securityfs: securityfs_remove should handle IS_ERR pointers
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>
Diffstat (limited to 'security/inode.c')
-rw-r--r-- | security/inode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/security/inode.c b/security/inode.c index f3b91bfbe4cb..f7496c6a022b 100644 --- a/security/inode.c +++ b/security/inode.c @@ -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; |