mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-16 13:34:30 +00:00
LSM: fix return value check in safesetid_init_securityfs()
In case of error, the function securityfs_create_dir() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Fixes: aeca4e2ca65c ("LSM: add SafeSetID module that gates setid calls") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Acked-by: Kees Cook <keescook@chromium.org> Signed-off-by: James Morris <james.morris@microsoft.com>
This commit is contained in:
parent
c67e8ec03f
commit
e7a44cfd63
@ -167,7 +167,7 @@ static int __init safesetid_init_securityfs(void)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
safesetid_policy_dir = securityfs_create_dir("safesetid", NULL);
|
safesetid_policy_dir = securityfs_create_dir("safesetid", NULL);
|
||||||
if (!safesetid_policy_dir) {
|
if (IS_ERR(safesetid_policy_dir)) {
|
||||||
ret = PTR_ERR(safesetid_policy_dir);
|
ret = PTR_ERR(safesetid_policy_dir);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user