EVM: fix return value check in evm_write_xattrs()
In case of error, the function audit_log_start() returns NULL pointer
not ERR_PTR(). The IS_ERR() test in the return value check should be
replaced with NULL test.
Fixes: fa516b66a1
("EVM: Allow runtime modification of the set of verified xattrs")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
This commit is contained in:
parent
6eb864c1d9
commit
3dd0f18c70
|
@ -193,8 +193,8 @@ static ssize_t evm_write_xattrs(struct file *file, const char __user *buf,
|
||||||
return -E2BIG;
|
return -E2BIG;
|
||||||
|
|
||||||
ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_INTEGRITY_EVM_XATTR);
|
ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_INTEGRITY_EVM_XATTR);
|
||||||
if (IS_ERR(ab))
|
if (!ab)
|
||||||
return PTR_ERR(ab);
|
return -ENOMEM;
|
||||||
|
|
||||||
xattr = kmalloc(sizeof(struct xattr_list), GFP_KERNEL);
|
xattr = kmalloc(sizeof(struct xattr_list), GFP_KERNEL);
|
||||||
if (!xattr) {
|
if (!xattr) {
|
||||||
|
|
Loading…
Reference in New Issue