From: Wei Yongjun Date: Thu, 11 Jan 2018 11:12:55 +0000 (+0000) Subject: test_firmware: fix missing unlock on error in config_num_requests_store() X-Git-Tag: Ubuntu-5.13.0-19.19~11685^2~10 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=a5e1923356505e46476c2fb518559b7a4d9d25b1;p=mirror_ubuntu-jammy-kernel.git test_firmware: fix missing unlock on error in config_num_requests_store() Add the missing unlock before return from function config_num_requests_store() in the error handling case. Fixes: c92316bf8e94 ("test_firmware: add batched firmware tests") Cc: stable Signed-off-by: Wei Yongjun Signed-off-by: Greg Kroah-Hartman --- diff --git a/lib/test_firmware.c b/lib/test_firmware.c index 1e907dd3b4fe..078a61480573 100644 --- a/lib/test_firmware.c +++ b/lib/test_firmware.c @@ -371,6 +371,7 @@ static ssize_t config_num_requests_store(struct device *dev, if (test_fw_config->reqs) { pr_err("Must call release_all_firmware prior to changing config\n"); rc = -EINVAL; + mutex_unlock(&test_fw_mutex); goto out; } mutex_unlock(&test_fw_mutex);