Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp199959pxm; Tue, 1 Mar 2022 18:31:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJwh2mxbW3vQgp1m+LH+gOYCL/J+eAPGU3PDMKRvMmB5S4FfMNGFTemVUJOCa7hwF1WZZi+z X-Received: by 2002:a17:90b:4c8f:b0:1bc:a64b:805 with SMTP id my15-20020a17090b4c8f00b001bca64b0805mr1601698pjb.156.1646188261709; Tue, 01 Mar 2022 18:31:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646188261; cv=none; d=google.com; s=arc-20160816; b=upDrPqwGuYsWtRVaFAUv3SJGOgW8yJuG0WUxIs6uRgQxpqVTNDK90hIoKdbYgNoLiA FRky8XqB2hb+09dkqWozoskr4aL6XqOZAeOeoUGScc6qeuwzGdRJ0MNsRqNV8dnbLqSZ 1p1W5o0ia3bhN6UhyEHOSWbJcAtcMc0H1THoELuHMrAtGC5f8pAse+CgfeeI47fqJRJH ufoS+VcK2ZGAb6fCxrQ08B5gvIZeDAzjlSCoeOkvVtJtf8zb0M5cE5GER2xMochUJWDp QSqvh2UEx67qm9GuAHmwcxgKaf0prv3HtkI5Co9Gmx35NGNxMcv1kKaeQXonZHEzRdeB TWYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=v4F2tWC4wkOyxXdDWha8Au3IzAIxeFvnWAijI+x+JE8=; b=i9ChVN+mqDguiwt9Cv0PERI0rDZcduWpVhrKr3Hg1PDuaBiQfl6SU79ZNfd34FQ0wl pUqEPeRTCA0Ff4mwYjduN1qiAKDH9A5sE8+nxzrfmi1zdb91VUNhP92jw36/Wni5ihGT kk1SRLNJoJGg2kM6j7WC/VCuDB+uMdF7pTeLyMPRYauaH4fYdpCrQ1fqVMm5H7Wa61bY 9ATnIFEcJn75DRZXOh/xPTmfVlg7y6+pYrVu+xUa++ivTzI4xKqdTAeCTTiTircEWupH aqMc536UVI/O1s2qPsYH63jRt6bmwHpYaA8mTP3b01PBqZmSRjHAxP0xF7fAitkCskci SMOw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-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 q9-20020a170902dac900b0014ff9239f3asi15823549plx.226.2022.03.01.18.30.38; Tue, 01 Mar 2022 18:31:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235965AbiCAQf2 (ORCPT + 99 others); Tue, 1 Mar 2022 11:35:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236148AbiCAQf0 (ORCPT ); Tue, 1 Mar 2022 11:35:26 -0500 Received: from elvis.franken.de (elvis.franken.de [193.175.24.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3E19F5FF3F; Tue, 1 Mar 2022 08:34:45 -0800 (PST) Received: from uucp (helo=alpha) by elvis.franken.de with local-bsmtp (Exim 3.36 #1) id 1nP5SV-0006n6-00; Tue, 01 Mar 2022 17:34:43 +0100 Received: by alpha.franken.de (Postfix, from userid 1000) id C49B5C28F0; Tue, 1 Mar 2022 17:29:50 +0100 (CET) Date: Tue, 1 Mar 2022 17:29:50 +0100 From: Thomas Bogendoerfer To: Hangyu Hua Cc: john@phrozen.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mips: ralink: fix a refcount leak in ill_acc_of_setup() Message-ID: <20220301162950.GA13091@alpha.franken.de> References: <20220228073537.31621-1-hbh25y@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220228073537.31621-1-hbh25y@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_NONE,T_SCC_BODY_TEXT_LINE,T_SPF_HELO_PERMERROR 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-kernel@vger.kernel.org On Mon, Feb 28, 2022 at 03:35:37PM +0800, Hangyu Hua wrote: > of_node_put(np) needs to be called when pdev == NULL. > > Signed-off-by: Hangyu Hua > --- > arch/mips/ralink/ill_acc.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/mips/ralink/ill_acc.c b/arch/mips/ralink/ill_acc.c > index 115a69fc20ca..f395ae218470 100644 > --- a/arch/mips/ralink/ill_acc.c > +++ b/arch/mips/ralink/ill_acc.c > @@ -61,6 +61,7 @@ static int __init ill_acc_of_setup(void) > pdev = of_find_device_by_node(np); > if (!pdev) { > pr_err("%pOFn: failed to lookup pdev\n", np); > + of_node_put(np); > return -EINVAL; > } > > -- > 2.25.1 applied to mips-next. Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]