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=-14.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 1C0F9C2D0E4 for ; Fri, 27 Nov 2020 11:13:51 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8F69E21527 for ; Fri, 27 Nov 2020 11:13:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="PFfFlbka" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8F69E21527 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=vRgIkkO/U89Cu/a1co7dLdLkzDqiP1fapNkQUn3O2ps=; b=PFfFlbkaJ8r/OfeQ9IRy444iA jg9JAkxeleTK+ufeob5Kq2+3W9b3Xg13YjZ8/XFda5ADY3a5WlChz6rKKxR5wmAQKwNwTOeH2IW9i pwM38KPP7nvAg1I+MBaoxvD0nuOnOqkjioRBSkYvZhChfEUhQhLSacEAkabiAGOBfySYWbttMOA2U In/DWk4TT7B/WAz7HhWNR1vc9D23ERdD+qedldcI1Ta60r5UH7lQe7zVqzs01IkC0ZHq+gH3nv1iN dz7Vd0JS2Twv/oVtMjjZt2PmSEmnFC4iFpfdT6rJ9veqAZRixb926Nh6iX2lpoxRrYSjRFMaKcRda WHCUsw8/A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kibgB-00052Y-Mx; Fri, 27 Nov 2020 11:12:43 +0000 Received: from mail-wm1-f68.google.com ([209.85.128.68]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kiaIl-00042V-RS for linux-arm-kernel@lists.infradead.org; Fri, 27 Nov 2020 09:44:30 +0000 Received: by mail-wm1-f68.google.com with SMTP id c198so4570075wmd.0 for ; Fri, 27 Nov 2020 01:44:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=0rcaXN0DZqE7YXIm9z0wb34aVoGoLqt6Pi2bXEDuuYM=; b=qxKmJknPo93NHrbt6YifMQLZB+786EBsVw85nCdn5a4IYGippjSYf4OJsY2cIj+EiK LRn54NHCOk7Mo4g9HeuiYMBRIvU6ixwMhgWQFfA8nM5L6B40j8wKrtIzF6TdwTY2p1p+ Hn9nsYKTPEfhvvTCQzt9yTFpLpwei69b901AgFhEEBR/pHhFHKWSBdqXD6D9a7siMrwV O90daJw1jWVSe0UHs1lzJKqEp+3PjWE20zy6v3UoODBy3Wfsc6ClNjBxGsB9HPcD3TDH Z19R0lpCDPhdOk6Vz+rxwAANu+99vWDr4AIiF3bhXOPNVyrkpqChOrjAiyyG7cARxtGk RalA== X-Gm-Message-State: AOAM531GLbsfg1rgmbfqpgyo5rX0AfcXVYWtsvleGBanQUdJW6smPfov dh4VHOiupY57s10E5+XZcILBf4hGj4AMlA== X-Google-Smtp-Source: ABdhPJzpw84z6c9Q6BcltT41XlX4adRZ0eiDKEb26LyiIg2prGdDUJwUQfyb5jqSAJL7qmnxzepTrg== X-Received: by 2002:a1c:9dd7:: with SMTP id g206mr8199701wme.49.1606470256949; Fri, 27 Nov 2020 01:44:16 -0800 (PST) Received: from kozik-lap (adsl-84-226-167-205.adslplus.ch. [84.226.167.205]) by smtp.googlemail.com with ESMTPSA id o13sm12131106wmc.44.2020.11.27.01.44.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Nov 2020 01:44:15 -0800 (PST) Date: Fri, 27 Nov 2020 10:44:14 +0100 From: Krzysztof Kozlowski To: Qinglang Miao Subject: Re: [PATCH] hwrng: exynos - fix reference leak in exynos_trng_probe Message-ID: <20201127094414.GA10679@kozik-lap> References: <20201127094446.121277-1-miaoqinglang@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201127094446.121277-1-miaoqinglang@huawei.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201127_044428_443567_BFE7945D X-CRM114-Status: GOOD ( 20.16 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-samsung-soc@vger.kernel.org, =?utf-8?Q?=C5=81ukasz?= Stelmach , linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Nov 27, 2020 at 05:44:46PM +0800, Qinglang Miao wrote: > pm_runtime_get_sync will increment pm usage counter even it > failed. Forgetting to putting operation will result in a > reference leak here. > > A new function pm_runtime_resume_and_get is introduced in > [0] to keep usage counter balanced. So We fix the reference > leak by replacing it with new funtion. > > [0] dd8088d5a896 ("PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter") Do not put such dependencies into the commit message - it does not bring useful information to the history. Store it under '---' separator. > > Fixes: 6cd225cc5d8a ("hwrng: exynos - add Samsung Exynos True RNG driver") > Reported-by: Hulk Robot > Signed-off-by: Qinglang Miao > --- > drivers/char/hw_random/exynos-trng.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/char/hw_random/exynos-trng.c b/drivers/char/hw_random/exynos-trng.c > index 8e1fe3f8d..666246bc8 100644 > --- a/drivers/char/hw_random/exynos-trng.c > +++ b/drivers/char/hw_random/exynos-trng.c > @@ -132,7 +132,7 @@ static int exynos_trng_probe(struct platform_device *pdev) > return PTR_ERR(trng->mem); > > pm_runtime_enable(&pdev->dev); > - ret = pm_runtime_get_sync(&pdev->dev); > + ret = pm_runtime_resume_and_get(&pdev->dev); This cannot be applied. Fix it by replacing err_clock label with this one. Best regards, Krzysztof _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel