Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3147176pxf; Mon, 15 Mar 2021 02:40:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyrMy2aIJW/lR5Hny1ympynw7oAOFjrBWP3DXZ9mRmzXw2z+HtzBj4Dar8YIJ9gSLPevEyZ X-Received: by 2002:aa7:d987:: with SMTP id u7mr28484718eds.326.1615801215862; Mon, 15 Mar 2021 02:40:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615801215; cv=none; d=google.com; s=arc-20160816; b=pGIEApNO9yvjOYZnrfdKW7Eu9rj3Y7Wa8NztApP5mBHNhv7hGXA5NLS1oLEc2GsmOE 7DlrFjUEjzggIDYEqlsXxtN6qLDoZfieHEQ4RHIakOQIIkcAcIZaeN2XKjcTykWjIeJA VW2W2i5P9kZkqwUAvLdDC2AXFg1F6FNQ0Yl+JRduRglqymMscpCXh6YN9wGv7QAcPIjJ QXxgot5cymwYC0Qfluv9q+zqndWOzHdiGbOfDq8u6nubdid854Z79/V/T7L4N4ObnpfF XZaNuvGpUcVeLTdJmrmV6IlEWPWsmEV38Y/FYy0TZSv1NZDXV+dJKoEN6/QpPm8SGyBu 67dw== 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=3qlOT5uUZ+YLrom4qb6ld9dq4tKFakPJF6PM6+FP08Y=; b=KwJ2qLepmJDMnRSBYMvp8FTI7p7+vwg9HsWgIJXHWT0DPCM620n9r0DtVPOnmaqysa oSudKHltLNzbDap2BqhvICQBbSfk2BidIq5+4H8MhTnEThQUwO9P/lCjwK9Ds59y1yrv E8xuAj19wRi60Ujnzqi6cF45/IpKKTzCko5Ewnb20oE7yqIwweygaKCD/vBZrWTm7dJm p/SgiTpz3cwTS5oz7OL6CohBJrx3aXr4YpZU5uzSjZUQUavwB4Bz4KcwNYRPCuCCSg9r yVsA70cypm51N4T/HsH147lBS3lTZCtC746ghi8arcBHB6mtTsHq21FnPJi9mhJbrgqV zHZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=KRZSuGKR; 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 d22si9951082edu.604.2021.03.15.02.39.52; Mon, 15 Mar 2021 02:40:15 -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=KRZSuGKR; 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 S229467AbhCOJiz (ORCPT + 99 others); Mon, 15 Mar 2021 05:38:55 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:15768 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229524AbhCOJiX (ORCPT ); Mon, 15 Mar 2021 05:38:23 -0400 Received: from epcas1p1.samsung.com (unknown [182.195.41.45]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20210315093819epoutp014613f71ce720ce5580c423275729b0be~seon52d2d0168001680epoutp01O for ; Mon, 15 Mar 2021 09:38:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20210315093819epoutp014613f71ce720ce5580c423275729b0be~seon52d2d0168001680epoutp01O DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1615801099; bh=3qlOT5uUZ+YLrom4qb6ld9dq4tKFakPJF6PM6+FP08Y=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=KRZSuGKR/4K3Q23RxNroyHLVDtbixG7PDvDknUNYJVEwjyBq0K3AVklrXQmR9CPOf LBoHspMeICKERWR1PttA2hVvv+1sZHMrFRuKz0TimZwQVkf1dIhRWKhSuc7nGYKOra oXOnLV24toMzDOJIRgZ723TJxWYXAOodLq2qBkfg= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas1p2.samsung.com (KnoxPortal) with ESMTP id 20210315093818epcas1p22c58560b57adb4f0b3bacb71c100dc02~seonZWTl12044420444epcas1p2z; Mon, 15 Mar 2021 09:38:18 +0000 (GMT) Received: from epsmges1p2.samsung.com (unknown [182.195.40.153]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4DzWZ03Gpwz4x9Q0; Mon, 15 Mar 2021 09:38:16 +0000 (GMT) Received: from epcas1p3.samsung.com ( [182.195.41.47]) by epsmges1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 92.C9.63458.80B2F406; Mon, 15 Mar 2021 18:38:16 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas1p3.samsung.com (KnoxPortal) with ESMTPA id 20210315093815epcas1p32308b5dd2a04df776bdac997e20ce094~seoki7kcz2884728847epcas1p3r; Mon, 15 Mar 2021 09:38:15 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20210315093815epsmtrp1fcc3643f1e2f4e74108bc34993012487~seokiKwp_0925109251epsmtrp1R; Mon, 15 Mar 2021 09:38:15 +0000 (GMT) X-AuditID: b6c32a36-6c9ff7000000f7e2-80-604f2b08c298 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 63.DF.13470.70B2F406; Mon, 15 Mar 2021 18:38:15 +0900 (KST) Received: from [10.113.221.102] (unknown [10.113.221.102]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20210315093815epsmtip1101d5f3d12dda5bf2f6fefb917648e48~seokVao4y0057100571epsmtip1o; Mon, 15 Mar 2021 09:38:15 +0000 (GMT) Subject: Re: [PATCH v2] 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, stable@vger.kernel.org From: Chanwoo Choi Organization: Samsung Electronics Message-ID: Date: Mon, 15 Mar 2021 18:54:52 +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: <20210315093123.20049-1-lukasz.luba@arm.com> Content-Language: en-US Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupik+LIzCtJLcpLzFFi42LZdlhTX5dD2z/B4MVhEYuzTW/YLS7vmsNm 8bn3CKPFwqYWdovbjSvYLBZsfMTowOaxZt4aRo++LasYPT5vkgtgjsq2yUhNTEktUkjNS85P ycxLt1XyDo53jjc1MzDUNbS0MFdSyEvMTbVVcvEJ0HXLzAHaq6RQlphTChQKSCwuVtK3synK Ly1JVcjILy6xVUotSMkpsCzQK07MLS7NS9dLzs+1MjQwMDIFKkzIztj7fjNjwXnOiuWzPrA2 MN5l72Lk5JAQMJFY+2EhaxcjF4eQwA5GiaXbnjNDOJ8YJbZ+PMEI4XxjlJh6awIbTMuTd2ug qvYySkyZdQfKec8o0d+znxmkSlggSuLKhP1gS0QE4iUWHvoAZjMLBErMaD3HCmKzCWhJ7H9x A2wqv4CixNUfjxlBbF4BO4mZ2yYwgdgsAqoS6xb/B5spKhAmcXJbC1SNoMTJmU9YQGxOAUuJ ucdXsEDMF5e49WQ+E4Q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QnEZhFQlVi3+D8ziC0qECaxc8ljJogaQYmT M5+wgNicApYSc4+vALOZBdQl/sy7xAxhi0vcejKfCcKWl9j+dg7zBEbhWUjaZyFpmYWkZRaS lgWMLKsYJVMLinPTc4sNCwzzUsv1ihNzi0vz0vWS83M3MYKjRUtzB+P2VR/0DjEycTAeYpTg YFYS4f2s45sgxJuSWFmVWpQfX1Sak1p8iFGag0VJnPdC18l4IYH0xJLU7NTUgtQimCwTB6dU A9N0x3lyoSennPFrfNx0YsmKpIrz6sliviniRkKKG6WFvsafV7RrvC/OGX7Ttbdh/VM5nty1 3943eP/4zTrj0UPduxU9t8pW8RQwSbZpB2ZPajmkkn0zSYSXeYbARGm2hfkxJQvtU+/NPBCs kMTFtywjv6pEXMhv5s9Zf/tuvJsWszzf6emtVMkO93R/Xu25ysxTn01l+JbO5aPcINU3k8XN cOL/Hp+P5RtfJV/6V7RicXJcw8P2K8VxXNIlXNdkz4t27AgU5k1qZsg6/+PqrxaF35eKlKWr Aip3i/Rv715faWzrcu+T6Z/PVw19TTn1K2+lNl68X2Wj0fh1T8It/cd7r7zbOaMlSHPpbfk1 SizFGYmGWsxFxYkAFukFzgUDAAA= X-CMS-MailID: 20210315093815epcas1p32308b5dd2a04df776bdac997e20ce094 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: 20210315093239epcas1p4516341a9f5614f59bfeb6af66e146540 References: <20210315093123.20049-1-lukasz.luba@arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/15/21 6:31 PM, 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. > > Cc: v5.9+ # v5.9+ > Fixes: 4dc3bab8687f ("PM / devfreq: Add support delayed timer for polling mode") > Signed-off-by: Lukasz Luba > --- > v2: > - added fixes tag and CC stable v5.9+ > - used capital letter in commit header > > > 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) { > Applied it. Thanks. -- Best Regards, Chanwoo Choi Samsung Electronics