Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2521768rwb; Fri, 9 Dec 2022 03:15:49 -0800 (PST) X-Google-Smtp-Source: AA0mqf5LNCK4aztvkhGECGwJWeTdOB4OQKUDAsG9VPMHQYLbgsYkICdu5zVU1/kOsyOJYXAndFZc X-Received: by 2002:a17:906:164d:b0:7ad:e255:9238 with SMTP id n13-20020a170906164d00b007ade2559238mr4316349ejd.21.1670584549434; Fri, 09 Dec 2022 03:15:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670584549; cv=none; d=google.com; s=arc-20160816; b=GzCPuUnyX/xuDz5xTMixHRHkYCxRK0YniFoOFJgYBQOFAbh5sLbpmuBs8XtVERmLbC RdDNRvlZnoqDLSj3cV2pIib/FULd38MzK67kPzxCNPSQA7nsJFXc4yt6DgEOSkGhfqH7 5Earq7/RdjWYSbQK0W7pU8MbvsiiK2bSMnUCzfDXnMSJAZQgRSa5W4N+kO9Skdb+lHWn 9Hk4FH73KMPYyC1wmiB0sVu2hVVCap+hmrn3AS49o1UPGZGp9t9phDntXbdLI1Z/2ozk TJt264+6XFNrHwjbxv7Khnom+6TETkzfIecUcfvb197OfBFDGSAiTg7yvjMbuPU+k0Xo vbbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=U2j4l/hQEIF0kqW/issv2kWuYFSO+GOY92i5H/iSjsw=; b=lqZKkecEP4WLZogGWQfYh3VX0E8Xv6UU6jgv8jID5ZcfpCtq9h8TNjrrDch7mw9w1S gXWFc63pmP0eoqqDTo+S4emk4j8YqMRhfbHnLwFNYGwW7MKqRnysBsIbuIMOjW7Mrrqo 0crGPWNxnoVQb26OiUgUjTBHT1+cyVKka8B2puDzWZlQLWa6BAMGwRSR/G8KCzBcOqdF Dw3Q8LxsF5ESr4xPEFiQZ1BpNUwtsQKqCX7OUMXE+XE90Ch+MdZkOPbQxIZH5YjmCIrx A9aLkw4zc8lxUH7T+4sw3cgqDwHxD0fUj20TSvrKCuLXXdwvSPoCKr6/LPyTB/cFzAGh 85DQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sd42-20020a1709076e2a00b007c07f7713d7si1126088ejc.99.2022.12.09.03.15.25; Fri, 09 Dec 2022 03:15:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229784AbiLILIl (ORCPT + 99 others); Fri, 9 Dec 2022 06:08:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229573AbiLILIk (ORCPT ); Fri, 9 Dec 2022 06:08:40 -0500 Received: from formenos.hmeau.com (helcar.hmeau.com [216.24.177.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA6C954762 for ; Fri, 9 Dec 2022 03:08:39 -0800 (PST) Received: from loth.rohan.me.apana.org.au ([192.168.167.2]) by formenos.hmeau.com with smtp (Exim 4.94.2 #2 (Debian)) id 1p3bEu-005glC-T5; Fri, 09 Dec 2022 19:08:25 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Fri, 09 Dec 2022 19:08:24 +0800 Date: Fri, 9 Dec 2022 19:08:24 +0800 From: Herbert Xu To: Xiongfeng Wang Cc: olivia@selenic.com, mpm@selenic.com, mb@bu3sch.de, dilinger@queued.net, linux-crypto@vger.kernel.org, yangyingliang@huawei.com Subject: Re: [PATCH v2 0/2] hwrng: Fix PCI device refcount leak Message-ID: References: <20221202132234.60631-1-wangxiongfeng2@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221202132234.60631-1-wangxiongfeng2@huawei.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Fri, Dec 02, 2022 at 09:22:32PM +0800, Xiongfeng Wang wrote: > for_each_pci_dev() is implemented by pci_get_device(). The comment of > pci_get_device() says that it will increase the reference count for the > returned pci_dev and also decrease the reference count for the input > pci_dev @from if it is not NULL. > > If we break for_each_pci_dev() loop with pdev not NULL, we need to call > pci_dev_put() to decrease the reference count. Add the missing > pci_dev_put() for amd-hwrng and geode-hwrng. > > > ChangeLog: > v1 -> v2: > 1. fix error in amd_rng_mod_exit() > 2. also add refcount leak fix for geode-hwrng > > Xiongfeng Wang (2): > hwrng: amd - Fix PCI device refcount leak > hwrng: geode - Fix PCI device refcount leak > > drivers/char/hw_random/amd-rng.c | 18 ++++++++++----- > drivers/char/hw_random/geode-rng.c | 36 +++++++++++++++++++++++------- > 2 files changed, 41 insertions(+), 13 deletions(-) > > -- > 2.20.1 All applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt