Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932723AbeAKLGx (ORCPT + 1 other); Thu, 11 Jan 2018 06:06:53 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:3776 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932285AbeAKLGw (ORCPT ); Thu, 11 Jan 2018 06:06:52 -0500 From: Wei Yongjun To: Joe Perches , Greg Kroah-Hartman , "Luis R. Rodriguez" , "Zhang Rui" , Felipe Balbi , "Andy Shevchenko" CC: Wei Yongjun , , Subject: [PATCH -next] test_firmware: fix missing unlock on error in config_num_requests_store() Date: Thu, 11 Jan 2018 11:12:55 +0000 Message-ID: <1515669175-125502-1-git-send-email-weiyongjun1@huawei.com> X-Mailer: git-send-email 1.8.3.1 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: 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") Signed-off-by: Wei Yongjun --- lib/test_firmware.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/test_firmware.c b/lib/test_firmware.c index 964784d..4647647 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);