mirror of
https://github.com/adulau/aha.git
synced 2024-12-29 04:06:22 +00:00
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>
This commit is contained in:
parent
2ea5814472
commit
fc5d81e69d
1 changed files with 2 additions and 1 deletions
|
@ -1754,7 +1754,8 @@ static inline void flush_unauthorized_files(struct files_struct * files)
|
||||||
get_file(devnull);
|
get_file(devnull);
|
||||||
} else {
|
} else {
|
||||||
devnull = dentry_open(dget(selinux_null), mntget(selinuxfs_mount), O_RDWR);
|
devnull = dentry_open(dget(selinux_null), mntget(selinuxfs_mount), O_RDWR);
|
||||||
if (!devnull) {
|
if (IS_ERR(devnull)) {
|
||||||
|
devnull = NULL;
|
||||||
put_unused_fd(fd);
|
put_unused_fd(fd);
|
||||||
fput(file);
|
fput(file);
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in a new issue