We need to unlock before returning on this error path.
Fixes: fa516b66a1bf ("EVM: Allow runtime modification of the set of verified xattrs")
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Mimi Zohar <[email protected]>
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);