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 <[email protected]>
Acked-by: Kees Cook <[email protected]>
Signed-off-by: James Morris <[email protected]>
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;
}