From patchwork Tue Jul 14 06:30:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 11661491 X-Patchwork-Delegate: cw00.choi@samsung.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A06A96C1 for ; Tue, 14 Jul 2020 06:26:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8F588221EA for ; Tue, 14 Jul 2020 06:26:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725890AbgGNG0c (ORCPT ); Tue, 14 Jul 2020 02:26:32 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:38160 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725788AbgGNG0b (ORCPT ); Tue, 14 Jul 2020 02:26:31 -0400 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 3DE8AC27C4EB75679A4B; Tue, 14 Jul 2020 14:26:26 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.487.0; Tue, 14 Jul 2020 14:26:19 +0800 From: Wei Yongjun To: MyungJoo Ham , Kyungmin Park , Chanwoo Choi CC: Wei Yongjun , , , Hulk Robot Subject: [PATCH -next] PM / devfreq: Fix missing unlock on error in devfreq_add_device() Date: Tue, 14 Jul 2020 06:30:25 +0000 Message-ID: <20200714063025.118829-1-weiyongjun1@huawei.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Add the missing unlock before return from function devfreq_add_device() in the error handling case. Fixes: d7c46505a7ad ("PM / devfreq: Add support delayed timer for polling mode") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun --- drivers/devfreq/devfreq.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index 5320c3b37f35..2b54a59bb281 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -788,6 +788,7 @@ struct devfreq *devfreq_add_device(struct device *dev, if (devfreq->profile->timer < 0 || devfreq->profile->timer >= DEVFREQ_TIMER_NUM) { + mutex_unlock(&devfreq->lock); goto err_out; }