]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
test_firmware: fix missing unlock on error in config_num_requests_store()
authorWei Yongjun <weiyongjun1@huawei.com>
Thu, 11 Jan 2018 11:12:55 +0000 (11:12 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 22 Jan 2018 15:55:38 +0000 (16:55 +0100)
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 <stable@vger.kernel.org>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
lib/test_firmware.c

index 1e907dd3b4fe4e50385a458994a4ef4be9d8b70e..078a6148057327209594c50243acb1910a1ea501 100644 (file)
@@ -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);