Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b5c90a75 authored by Dan Carpenter's avatar Dan Carpenter Committed by Mimi Zohar
Browse files

EVM: unlock on error path in evm_read_xattrs()



We need to unlock before returning on this error path.

Fixes: fa516b66 ("EVM: Allow runtime modification of the set of verified xattrs")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarMimi Zohar <zohar@linux.vnet.ibm.com>
parent a41d80ac
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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);