Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Akinobu Mita and committed by
James Morris
fc5d81e6 2ea58144

+2 -1
+2 -1
security/selinux/hooks.c
··· 1754 1754 get_file(devnull); 1755 1755 } else { 1756 1756 devnull = dentry_open(dget(selinux_null), mntget(selinuxfs_mount), O_RDWR); 1757 - if (!devnull) { 1757 + if (IS_ERR(devnull)) { 1758 + devnull = NULL; 1758 1759 put_unused_fd(fd); 1759 1760 fput(file); 1760 1761 continue;