From: David Howells Date: Thu, 29 Jan 2015 12:02:32 +0000 (+0000) Subject: TOMOYO: Use d_is_dir() rather than d_inode and S_ISDIR() X-Git-Tag: v4.9.8~4725^2~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e656a8eb2e0b35258219bb46929323e4d1f49dad;p=platform%2Fkernel%2Flinux-rpi3.git TOMOYO: Use d_is_dir() rather than d_inode and S_ISDIR() Use d_is_dir() rather than d_inode and S_ISDIR(). Note that this will include fake directories such as automount triggers. Signed-off-by: David Howells Signed-off-by: Al Viro --- diff --git a/security/tomoyo/file.c b/security/tomoyo/file.c index 4003907..c151a18 100644 --- a/security/tomoyo/file.c +++ b/security/tomoyo/file.c @@ -905,11 +905,9 @@ int tomoyo_path2_perm(const u8 operation, struct path *path1, !tomoyo_get_realpath(&buf2, path2)) goto out; switch (operation) { - struct dentry *dentry; case TOMOYO_TYPE_RENAME: case TOMOYO_TYPE_LINK: - dentry = path1->dentry; - if (!dentry->d_inode || !S_ISDIR(dentry->d_inode->i_mode)) + if (!d_is_dir(path1->dentry)) break; /* fall through */ case TOMOYO_TYPE_PIVOT_ROOT: