summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2006-11-27 15:16:48 +0900
committerJames Morris <jmorris@namei.org>2006-11-27 10:22:43 -0500
commitfc5d81e69d15c65ca20d9e5b4e242690e3e9c27d (patch)
tree487e7c5e25fb91246712747cc9595f750cffa30b
parent2ea5814472c3c910aed5c5b60f1f3b1000e353f1 (diff)
downloadop-kernel-dev-fc5d81e69d15c65ca20d9e5b4e242690e3e9c27d.zip
op-kernel-dev-fc5d81e69d15c65ca20d9e5b4e242690e3e9c27d.tar.gz
selinux: fix dentry_open() error check
The return value of dentry_open() shoud be checked by IS_ERR(). Cc: Stephen Smalley <sds@tycho.nsa.gov> Cc: James Morris <jmorris@namei.org> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: James Morris <jmorris@namei.org>
-rw-r--r--security/selinux/hooks.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 8ab5679..28ee187 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -1754,7 +1754,8 @@ static inline void flush_unauthorized_files(struct files_struct * files)
get_file(devnull);
} else {
devnull = dentry_open(dget(selinux_null), mntget(selinuxfs_mount), O_RDWR);
- if (!devnull) {
+ if (IS_ERR(devnull)) {
+ devnull = NULL;
put_unused_fd(fd);
fput(file);
continue;
OpenPOWER on IntegriCloud