linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wenwen Wang <wenwen@cs.uga.edu>
To: Sudarsana Reddy Kalluru <skalluru@marvell.com>
Cc: Ariel Elior <aelior@marvell.com>,
	GR-everest-linux-l2 <GR-everest-linux-l2@marvell.com>,
	"David S. Miller" <davem@davemloft.net>,
	"open list:QLOGIC QL4xxx ETHERNET DRIVER"
	<netdev@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>,
	Wenwen Wang <wenwen@cs.uga.edu>
Subject: Re: [EXT] [PATCH] qed: Add cleanup in qed_slowpath_start()
Date: Wed, 21 Aug 2019 00:31:46 -0400	[thread overview]
Message-ID: <CAAa=b7dKCjCRU3gik3ZPVP7WWMfEYqEmq_4rd7vnSLoOiK5nOw@mail.gmail.com> (raw)
In-Reply-To: <MN2PR18MB2528D8046DFC6BB880D8EFF6D3D20@MN2PR18MB2528.namprd18.prod.outlook.com>

On Tue, Aug 13, 2019 at 6:46 AM Sudarsana Reddy Kalluru
<skalluru@marvell.com> wrote:
>
> > -----Original Message-----
> > From: Wenwen Wang <wenwen@cs.uga.edu>
> > Sent: Tuesday, August 13, 2019 3:35 PM
> > To: Wenwen Wang <wenwen@cs.uga.edu>
> > Cc: Ariel Elior <aelior@marvell.com>; GR-everest-linux-l2 <GR-everest-linux-
> > l2@marvell.com>; David S. Miller <davem@davemloft.net>; open
> > list:QLOGIC QL4xxx ETHERNET DRIVER <netdev@vger.kernel.org>; open list
> > <linux-kernel@vger.kernel.org>
> > 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 <wenwen@cs.uga.edu>
> > ---
> >  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
>

      reply	other threads:[~2019-08-21  4:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-13 10:05 [PATCH] qed: Add cleanup in qed_slowpath_start() Wenwen Wang
2019-08-13 10:46 ` [EXT] " Sudarsana Reddy Kalluru
2019-08-21  4:31   ` Wenwen Wang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAAa=b7dKCjCRU3gik3ZPVP7WWMfEYqEmq_4rd7vnSLoOiK5nOw@mail.gmail.com' \
    --to=wenwen@cs.uga.edu \
    --cc=GR-everest-linux-l2@marvell.com \
    --cc=aelior@marvell.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=skalluru@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).