Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d93e4c94 authored by Eric Paris's avatar Eric Paris Committed by James Morris
Browse files

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: default avatarEric Paris <eparis@redhat.com>
Signed-off-by: default avatarJames Morris <jmorris@namei.org>
parent 1a62e958
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;