Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fc5d81e6 authored by Akinobu Mita's avatar Akinobu Mita Committed by James Morris
Browse files

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: default avatarAkinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: default avatarJames Morris <jmorris@namei.org>
parent 2ea58144
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;