Commit e7a44cfd authored by Wei Yongjun's avatar Wei Yongjun Committed by James Morris

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: aeca4e2c ("LSM: add SafeSetID module that gates setid calls")
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Acked-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarJames Morris <james.morris@microsoft.com>
parent c67e8ec0
......@@ -167,7 +167,7 @@ static int __init safesetid_init_securityfs(void)
return 0;
safesetid_policy_dir = securityfs_create_dir("safesetid", NULL);
if (!safesetid_policy_dir) {
if (IS_ERR(safesetid_policy_dir)) {
ret = PTR_ERR(safesetid_policy_dir);
goto error;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment