mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Qiushi Wu <wu000273@umn.edu>,
	netdev@vger.kernel.org, oss-drivers@netronome.com
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Kangjie Lu <kjlu@umn.edu>
Subject: Re: [PATCH] nfp: abm: fix a memory leak bug
Date: Sun, 3 May 2020 13:30:13 +0200	[thread overview]
Message-ID: <75768a26-836d-2aa5-94c8-6d8183745a9c@web.de> (raw)

…
> Fix this issue by adding nfp_nsp_close(nsp) in the error path.

How do you think about a wording variant like the following?

   Subject:
   [PATCH v2] nfp: abm: Fix incomplete release of system resources in nfp_abm_vnic_set_mac()

   Change description:
   …
   Thus add a call of the function “nfp_nsp_close” for the completion
   of the exception handling.


…
> +++ b/drivers/net/ethernet/netronome/nfp/abm/main.c
> @@ -283,6 +283,7 @@  nfp_abm_vnic_set_mac(struct nfp_pf *pf, struct nfp_abm *abm, struct nfp_net *nn,
>  	if (!nfp_nsp_has_hwinfo_lookup(nsp)) {
>  		nfp_warn(pf->cpp, "NSP doesn't support PF MAC generation\n");
>  		eth_hw_addr_random(nn->dp.netdev);
> +		nfp_nsp_close(nsp);
>  		return;
>  	}

I suggest to reconsider the order for resource clean-up function calls
a bit more.

+		nfp_nsp_close(nsp);
-		eth_hw_addr_random(nn->dp.netdev);
-		return;
+		goto generate_random_address;


Should such a jump target be added in another update step?

Would you like to add the tag “Fixes”?

Regards,
Markus

             reply	other threads:[~2020-05-03 11:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-03 11:30 Markus Elfring [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-05-02 22:42 wu000273
2020-05-04 17:01 ` Jakub Kicinski
2020-05-04 19:05 ` David Miller

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=75768a26-836d-2aa5-94c8-6d8183745a9c@web.de \
    --to=markus.elfring@web.de \
    --cc=davem@davemloft.net \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kjlu@umn.edu \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=oss-drivers@netronome.com \
    --cc=wu000273@umn.edu \
    /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

all inboxes | Powered by JetHome®