From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A71DDC433E2 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 8C1E1217D8 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 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT 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; }