Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp389603ybl; Tue, 20 Aug 2019 22:27:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqyqulvqNy5d3q6RZtNUW2OH7YTL1Flx1nh38I1TQ3+wUVzrr2oin8hK3twKCb1ftWb0VFO/ X-Received: by 2002:a17:90a:24cc:: with SMTP id i70mr3729282pje.12.1566365241502; Tue, 20 Aug 2019 22:27:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566365241; cv=none; d=google.com; s=arc-20160816; b=Kyx3QHleTHh/v/JuR28xeUB9NE46SDBl3hw9lFJ9wDi+LRZ8foTV3p+FsymJDbCA5U fl5iKAtuvXyjrB97USZz6/4fZUN4YcFTV/fkBkRoRbLc54IxPklBgpAhgVu2bpWbZJcD UYHYebM4Skc3a9dkceHCENIs3IG2P2o/aO7lq0uzTWaQmA+8bjR0Ay4Z/3mRTIyH99VS LGULkoDbqEk6dPxHXmhOK1Y6AGHG1KIb7Or3PZJ/BqZFZbwScEhVghgIE6WPW1L6TBwT KWc+j2QmNuYpOM5MPxhvgBc2/ycF13BrfWs8zsqDd0FnrubsTnGqFN9qgZMc9RyDSSg7 XCCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=PiAENx5RUf09JrudvSVb7eS0C6mZ3fynTVTwqTSyPt8=; b=w7mWgxO+Y1u2vMiuGHNEUzeQUTAEG9P5EwiMc/c5cikkqN/CdoBVbeyWLkFMGMgmjC OD3kRZOPR4ZEJNs62arXEJTQFoZNIw2CC9GTVLfx06PqKggpkQGZTyoeDsyanW71U6se 8Q39NWlC0s5XN5KYTUVNlaKpnMVkDvdrXW+vMNrtZvlWVy2pffsbsdQcLh3uG9yKd3uF BCC5aNe8sZTa8YYU5g0MsxOGQwi+hxvlTvhlx8+slmC2IPprtylTo07DVe4tlK8M42G6 OS1CF5wbknmHRJjjdIe3MuXf5TM4MJl9+iDTRG87fabVPHZ0vagh9034rdCvgzphA3I3 W40Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r24si14573694pfh.257.2019.08.20.22.27.06; Tue, 20 Aug 2019 22:27:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727614AbfHUEcZ (ORCPT + 99 others); Wed, 21 Aug 2019 00:32:25 -0400 Received: from ajax.cs.uga.edu ([128.192.4.6]:44158 "EHLO ajax.cs.uga.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725866AbfHUEcZ (ORCPT ); Wed, 21 Aug 2019 00:32:25 -0400 Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com [209.85.208.171]) (authenticated bits=0) by ajax.cs.uga.edu (8.14.4/8.14.4) with ESMTP id x7L4WMoe069266 (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 21 Aug 2019 00:32:23 -0400 Received: by mail-lj1-f171.google.com with SMTP id l1so795910lji.12; Tue, 20 Aug 2019 21:32:23 -0700 (PDT) X-Gm-Message-State: APjAAAUL11Gw39KpL4NYef24UhbT582GgezPL+E++gdp13coDwblbYkw n40Psyg8TDmXil8gmZGOkJRWycFg3HeKMPxzbJM= X-Received: by 2002:a2e:5c5:: with SMTP id 188mr2582725ljf.166.1566361942335; Tue, 20 Aug 2019 21:32:22 -0700 (PDT) MIME-Version: 1.0 References: <1565690709-3186-1-git-send-email-wenwen@cs.uga.edu> In-Reply-To: From: Wenwen Wang Date: Wed, 21 Aug 2019 00:31:46 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [EXT] [PATCH] qed: Add cleanup in qed_slowpath_start() To: Sudarsana Reddy Kalluru Cc: Ariel Elior , GR-everest-linux-l2 , "David S. Miller" , "open list:QLOGIC QL4xxx ETHERNET DRIVER" , open list , Wenwen Wang Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 13, 2019 at 6:46 AM Sudarsana Reddy Kalluru wrote: > > > -----Original Message----- > > From: Wenwen Wang > > Sent: Tuesday, August 13, 2019 3:35 PM > > To: Wenwen Wang > > Cc: Ariel Elior ; GR-everest-linux-l2 > l2@marvell.com>; David S. Miller ; open > > list:QLOGIC QL4xxx ETHERNET DRIVER ; open list > > > > Subject: [EXT] [PATCH] qed: Add cleanup in qed_slowpath_start() > > > > External Email > > > > ---------------------------------------------------------------------- > > If qed_mcp_send_drv_version() fails, no cleanup is executed, leading to > > memory leaks. To fix this issue, redirect the execution to the label 'err3' > > before returning the error. > > > > Signed-off-by: Wenwen Wang > > --- > > drivers/net/ethernet/qlogic/qed/qed_main.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/net/ethernet/qlogic/qed/qed_main.c > > b/drivers/net/ethernet/qlogic/qed/qed_main.c > > index 829dd60..d16a251 100644 > > --- a/drivers/net/ethernet/qlogic/qed/qed_main.c > > +++ b/drivers/net/ethernet/qlogic/qed/qed_main.c > > @@ -1325,7 +1325,7 @@ static int qed_slowpath_start(struct qed_dev > > *cdev, > > &drv_version); > > if (rc) { > > DP_NOTICE(cdev, "Failed sending drv version > > command\n"); > > - return rc; > > + goto err3; > > In this case, we might need to free the ll2-buf allocated at the below path (?), > 1312 /* Allocate LL2 interface if needed */ > 1313 if (QED_LEADING_HWFN(cdev)->using_ll2) { > 1314 rc = qed_ll2_alloc_if(cdev); > May be by adding a new goto label 'err4'. Thanks for your suggestion! I will rework the patch. Wenwen > > > } > > } > > > > -- > > 2.7.4 >