Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752742AbdLEBN6 (ORCPT ); Mon, 4 Dec 2017 20:13:58 -0500 Received: from mail-qt0-f195.google.com ([209.85.216.195]:39883 "EHLO mail-qt0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752413AbdLEBFb (ORCPT ); Mon, 4 Dec 2017 20:05:31 -0500 X-Google-Smtp-Source: AGs4zMYoKw2s/7yJw5Jn0ZogXGiceWmP2cg1fHDKqARulF3+ELHjaCBglJa2FwxAuLBJo3I6Js4OJg== Subject: Re: [PATCH 02/10] net: bcmgenet: free netdev on of_match_node() error To: Arvind Yadav , wg@grandegger.com, mkl@pengutronix.de, michal.simek@xilinx.com, f.fainelli@gmail.com, davem@davemloft.net, Vladislav.Zakharov@synopsys.com Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org References: <1512242782-7134-1-git-send-email-arvind.yadav.cs@gmail.com> <1512242782-7134-3-git-send-email-arvind.yadav.cs@gmail.com> From: Doug Berger Message-ID: <6c661895-0587-26fb-cfd9-cf24dee2e002@gmail.com> Date: Mon, 4 Dec 2017 17:05:27 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <1512242782-7134-3-git-send-email-arvind.yadav.cs@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 963 Lines: 32 On 12/02/2017 11:26 AM, Arvind Yadav wrote: > The change is to call free_netdev(), If of_match_node() will fail. > > Signed-off-by: Arvind Yadav > --- > drivers/net/ethernet/broadcom/genet/bcmgenet.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c > index e2f1268..e0a8f79 100644 > --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c > +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c > @@ -3363,8 +3363,10 @@ static int bcmgenet_probe(struct platform_device *pdev) > > if (dn) { > of_id = of_match_node(bcmgenet_match, dn); > - if (!of_id) > - return -EINVAL; > + if (!of_id) { > + err = -EINVAL; > + goto err; > + } > } > > priv = netdev_priv(dev); > I agree with the fix if you want to resubmit separate from this series and please include a "fixes" tag. Thanks, Doug