mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-11-07 04:09:21 +00:00
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>
This commit is contained in:
parent
1a62e958fa
commit
d93e4c940f
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue