diff options
| author | Akinobu Mita <[email protected]> | 2006-11-27 06:16:48 +0000 |
|---|---|---|
| committer | James Morris <[email protected]> | 2006-11-27 15:22:43 +0000 |
| commit | fc5d81e69d15c65ca20d9e5b4e242690e3e9c27d (patch) | |
| tree | 487e7c5e25fb91246712747cc9595f750cffa30b /security/selinux/hooks.c | |
| parent | Fix 'ALIGN()' macro, take 2 (diff) | |
| download | kernel-fc5d81e69d15c65ca20d9e5b4e242690e3e9c27d.tar.gz kernel-fc5d81e69d15c65ca20d9e5b4e242690e3e9c27d.zip | |
selinux: fix dentry_open() error check
The return value of dentry_open() shoud be checked by IS_ERR().
Cc: Stephen Smalley <[email protected]>
Cc: James Morris <[email protected]>
Signed-off-by: Akinobu Mita <[email protected]>
Signed-off-by: James Morris <[email protected]>
Diffstat (limited to 'security/selinux/hooks.c')
| -rw-r--r-- | security/selinux/hooks.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 8ab5679a37a3..28ee187ed224 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; |
