From: Al Viro Date: Wed, 23 Jan 2013 21:24:16 +0000 (-0500) Subject: selinux: opened file can't have NULL or negative ->f_path.dentry X-Git-Tag: upstream/snapshot3+hdmi~5572^2~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=45e09bd51b2be1fbb86c2e3d5bb00d32744f1ecb;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git selinux: opened file can't have NULL or negative ->f_path.dentry Signed-off-by: Al Viro --- diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 84b59171..2fa28c8 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -3135,11 +3135,6 @@ static int selinux_file_fcntl(struct file *file, unsigned int cmd, switch (cmd) { case F_SETFL: - if (!file->f_path.dentry || !file->f_path.dentry->d_inode) { - err = -EINVAL; - break; - } - if ((file->f_flags & O_APPEND) && !(arg & O_APPEND)) { err = file_has_perm(cred, file, FILE__WRITE); break; @@ -3162,10 +3157,6 @@ static int selinux_file_fcntl(struct file *file, unsigned int cmd, case F_SETLK64: case F_SETLKW64: #endif - if (!file->f_path.dentry || !file->f_path.dentry->d_inode) { - err = -EINVAL; - break; - } err = file_has_perm(cred, file, FILE__LOCK); break; }