mirror of
https://github.com/torvalds/linux.git
synced 2024-11-11 22:51:42 +00:00
EVM: unlock on error path in evm_read_xattrs()
We need to unlock before returning on this error path.
Fixes: fa516b66a1
("EVM: Allow runtime modification of the set of verified xattrs")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
This commit is contained in:
parent
a41d80acfa
commit
b5c90a7526
@ -147,8 +147,10 @@ static ssize_t evm_read_xattrs(struct file *filp, char __user *buf,
|
||||
size += strlen(xattr->name) + 1;
|
||||
|
||||
temp = kmalloc(size + 1, GFP_KERNEL);
|
||||
if (!temp)
|
||||
if (!temp) {
|
||||
mutex_unlock(&xattr_list_mutex);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
list_for_each_entry(xattr, &evm_config_xattrnames, list) {
|
||||
sprintf(temp + offset, "%s\n", xattr->name);
|
||||
|
Loading…
Reference in New Issue
Block a user