Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3074813pxf; Mon, 15 Mar 2021 00:07:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwo1VIGcyQP7+DwHnbqC2Sz8wMRw8Y1csMD7O4vdltUMAaR6CILux09hkaM1E7GP3mWntan X-Received: by 2002:a05:6402:3595:: with SMTP id y21mr28150123edc.233.1615792058158; Mon, 15 Mar 2021 00:07:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615792058; cv=none; d=google.com; s=arc-20160816; b=D1CCztFDoEYZ5YgewE/UZkX4wBru2+/p6KyoijTyDw0JQG/ZoSzGJu1ZKTJyRv/Rj1 SmcjLYxHS6yfiMi1OQYiWMTkYr3PRbGST6Rp4AmnMxW2emKwbMaBUpASQFVTjKNbhUeJ 23fZSwvAC6HK+J6V/j3dFSs6OnXwXTNgW7NuR0PubSbT42bnaI5qizoAwYLEFTJLSh3x YkkKQGZld5s868EO74xFAtmW8RdEpkBUC7qAB+zfxgDdXRctLGnPB/+udDtE9uAJDmoQ A5LNK2AzrxRFrBROucrcuIQiQhvnZcx+h1hfEDDViSRRoJnazj+yieElvpHnI2bRLe92 iRsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:dlp-filter:cms-type :content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:organization:from:cc:to:subject :dkim-signature:dkim-filter; bh=K0AMjK6xDxixk6h8BOyJRSQvpEFk16GWw8ahalOQEnM=; b=w+cgb7WyTYF3m+29TBaMTCJCWvchlh26nN/GqN1qOKerB3LgkMUhsN7oLZW8N4BKam Uhj9I/Tiiu3aEu5gn16jPYivcGpdnFTmiR1EYuYpKuetoOjJOy3kLnt4qFIr65uuIBrC bDxvdTWt8eswild4LhbzoaqwJDoAHPr2HvYrIrNkVTyGSPqUmXagPGmN2Ppf+toP5Jft a+B5M0QoFwptoo6pWLkiAUb1SSCWPxY2rGXYEfujfRVnvgNTmuqFuqwimC79fSNeIpxm qFJ/JGuUsWEr8zwm7ZCb36h0eomvBgtYnfNMTKeiASluifTKnHoCYYGr7teb8MzKQKYU wf6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="EWduoRZ/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f2si10295672edn.109.2021.03.15.00.07.15; Mon, 15 Mar 2021 00:07:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="EWduoRZ/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229920AbhCOHED (ORCPT + 99 others); Mon, 15 Mar 2021 03:04:03 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:46478 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229925AbhCOHDn (ORCPT ); Mon, 15 Mar 2021 03:03:43 -0400 Received: from epcas1p1.samsung.com (unknown [182.195.41.45]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20210315070340epoutp01c0b25a3bd252db297c5af7f43aab7273~schmoojiU2647326473epoutp01I for ; Mon, 15 Mar 2021 07:03:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20210315070340epoutp01c0b25a3bd252db297c5af7f43aab7273~schmoojiU2647326473epoutp01I DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1615791820; bh=K0AMjK6xDxixk6h8BOyJRSQvpEFk16GWw8ahalOQEnM=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=EWduoRZ/P3kXSAEERc1yDnkuhAIIFeLfECZ0r6/hi1hr3ztJGz0j5qAXss2vXY3Tl Q60cUkS2XVVjKCBv8zQItYTYNlquUbHLkhnixQIKzybK3zbSLDYjK6bFHx7GWbfTCv KgPYkVfWf/nkm4s78uFB0CN73CmP3qCJ6/tCNxk8= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20210315070338epcas1p102ddff01d5b1e83377c4971132643c1e~schkJk7pu0105201052epcas1p1h; Mon, 15 Mar 2021 07:03:38 +0000 (GMT) Received: from epsmges1p4.samsung.com (unknown [182.195.40.152]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4DzS7W6qMqz4x9Py; Mon, 15 Mar 2021 07:03:35 +0000 (GMT) Received: from epcas1p4.samsung.com ( [182.195.41.48]) by epsmges1p4.samsung.com (Symantec Messaging Gateway) with SMTP id 29.A7.59147.3C60F406; Mon, 15 Mar 2021 16:03:31 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas1p4.samsung.com (KnoxPortal) with ESMTPA id 20210315070329epcas1p4a707a7b961b172fdd615c06731e6c61c~schbpogdT1473614736epcas1p4O; Mon, 15 Mar 2021 07:03:29 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20210315070329epsmtrp14610096271e6cf9a179a9383ee6a4288~schbpAfdO2428224282epsmtrp1h; Mon, 15 Mar 2021 07:03:29 +0000 (GMT) X-AuditID: b6c32a38-e53ff7000000e70b-d8-604f06c32441 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id BD.8B.13470.0C60F406; Mon, 15 Mar 2021 16:03:28 +0900 (KST) Received: from [10.113.221.102] (unknown [10.113.221.102]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20210315070328epsmtip2a118853963d9fef374eafed02c16d7d1~schbaaAUr1820518205epsmtip27; Mon, 15 Mar 2021 07:03:28 +0000 (GMT) Subject: Re: [PATCH] PM / devfreq: unlock mutex and free devfreq struct in error path To: Lukasz Luba , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Cc: myungjoo.ham@samsung.com, kyungmin.park@samsung.com From: Chanwoo Choi Organization: Samsung Electronics Message-ID: Date: Mon, 15 Mar 2021 16:20:05 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Thunderbird/59.0 MIME-Version: 1.0 In-Reply-To: <20210312184534.6423-1-lukasz.luba@arm.com> Content-Language: en-US Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpmk+LIzCtJLcpLzFFi42LZdljTQPcwm3+Cwe9HGhZnm96wW1zeNYfN 4nPvEUaLhU0t7Ba3G1ewObB6rJm3htGjb8sqRo/Pm+QCmKOybTJSE1NSixRS85LzUzLz0m2V vIPjneNNzQwMdQ0tLcyVFPISc1NtlVx8AnTdMnOAVioplCXmlAKFAhKLi5X07WyK8ktLUhUy 8otLbJVSC1JyCiwL9IoTc4tL89L1kvNzrQwNDIxMgQoTsjM29K9gLHjNWXFw4162Bsbv7F2M nBwSAiYSez/fYu1i5OIQEtjBKPFk93MWCOcTo8SFa03sEM43Romm1w1wLdM2zmYGsYUE9jJK vJwZD1H0nlHi6YSHQEUcHMIC4RJHtiaD1IgIxEssPPQBrJdZwFzi796zLCA2m4CWxP4XN9hA bH4BRYmrPx4zgti8AnYS3T3nwepZBFQlNpzdBRYXFQiTOLmtBapGUOLkzCdgczgFLCTu9kxl hpgvLnHryXwmCFteYvvbOcwgt0kI/GSXmNexhRniA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sJC42zOVGWKZusSfeZegbHGJW0/mM0HY8hLb385hnsAoPAtJ+ywkLbOQtMxC0rKAkWUVo2Rq QXFuem6xYYFhXmq5XnFibnFpXrpecn7uJkZwlGhp7mDcvuqD3iFGJg7GQ4wSHMxKIryfdXwT hHhTEiurUovy44tKc1KLDzFKc7AoifNe6DoZLySQnliSmp2aWpBaBJNl4uCUamBSNKvIvB+x cYLJ24QGHr/ZDQuCdFd+8StP2sfCKDgv51qrXu2s29skwycn/FZo7tg/1+jG/P5l/mJHXj9n W/D3aJxPyNS4Bf5C0/OuMyzMOPmqc1OARNOj+Kwji/gc/G4sPXBpd6t2m+3m5es1zGZaqrMc 3DxxV3KR/Dm5j+urS2pOCmxR7d35d59Rq8tSqdKo8CUvt6n4X8r2u++QlOORdM3iw7UjHKVr ljh1dyueSvp2rs32TCPjkren57sb6ZnPnr/rgN+aDsFFW7q905mzrknl3vrqpLp/HtsnrnVL medtOsDcsTvq1j3TB959Mxuv3muf3yNhOXfr7KyTk7+8eNqxvd7jn9G5owpNNy+xKrEUZyQa ajEXFScCANZ7F8EBAwAA X-CMS-MailID: 20210315070329epcas1p4a707a7b961b172fdd615c06731e6c61c X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: SVC_REQ_APPROVE CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20210312184551epcas1p2fe579b2a736cac2814b8a236869c4c27 References: <20210312184534.6423-1-lukasz.luba@arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Lukasz, On 3/13/21 3:45 AM, Lukasz Luba wrote: > The devfreq->lock is held for time of setup. Release the lock in the > error path, before jumping to the end of the function. > > Change the goto destination which frees the allocated memory. > > Signed-off-by: Lukasz Luba > --- > drivers/devfreq/devfreq.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c > index b6d3e7db0b09..99b2eeedc238 100644 > --- a/drivers/devfreq/devfreq.c > +++ b/drivers/devfreq/devfreq.c > @@ -822,7 +822,8 @@ struct devfreq *devfreq_add_device(struct device *dev, > > if (devfreq->profile->timer < 0 > || devfreq->profile->timer >= DEVFREQ_TIMER_NUM) { > - goto err_out; > + mutex_unlock(&devfreq->lock); > + goto err_dev; > } > > if (!devfreq->profile->max_state && !devfreq->profile->freq_table) { > Looks good to me. But, need to add the following information and please use capital letter of the first character of patch title. Thanks. Fixes: 4dc3bab8687f ("PM / devfreq: Add support delayed timer for polling mode") Also, need to send it to stable lkml. -- Best Regards, Chanwoo Choi Samsung Electronics