diff options
author | David Howells <dhowells@redhat.com> | 2015-01-29 07:02:31 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-02-22 11:38:39 -0500 |
commit | 729b8a3dee2bc873e4647e9384de9111548e599e (patch) | |
tree | 68e36ab6d1e2cde74df58097af1e8f62b72cdf22 /security/apparmor/path.c | |
parent | 7ac2856d99e8038d356767c81ef7f2e85d366441 (diff) |
Apparmor: Use d_is_positive/negative() rather than testing dentry->d_inode
Use d_is_positive(dentry) or d_is_negative(dentry) rather than testing
dentry->d_inode as the dentry may cover another layer that has an inode when
the top layer doesn't or may hold a 0,0 chardev that's actually a whiteout.
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'security/apparmor/path.c')
-rw-r--r-- | security/apparmor/path.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/security/apparmor/path.c b/security/apparmor/path.c index 35b394a75d76..71e0e3a15b9d 100644 --- a/security/apparmor/path.c +++ b/security/apparmor/path.c | |||
@@ -114,7 +114,7 @@ static int d_namespace_path(struct path *path, char *buf, int buflen, | |||
114 | * security_path hooks as a deleted dentry except without an inode | 114 | * security_path hooks as a deleted dentry except without an inode |
115 | * allocated. | 115 | * allocated. |
116 | */ | 116 | */ |
117 | if (d_unlinked(path->dentry) && path->dentry->d_inode && | 117 | if (d_unlinked(path->dentry) && d_is_positive(path->dentry) && |
118 | !(flags & PATH_MEDIATE_DELETED)) { | 118 | !(flags & PATH_MEDIATE_DELETED)) { |
119 | error = -ENOENT; | 119 | error = -ENOENT; |
120 | goto out; | 120 | goto out; |