netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@idosch.org>
To: Cong Wang <xiyou.wangcong@gmail.com>
Cc: netdev@vger.kernel.org
Subject: Re: [Patch net] genetlink: clean up family attributes allocations
Date: Fri, 12 Jun 2020 15:31:09 +0300	[thread overview]
Message-ID: <20200612123109.GA22179@splinter> (raw)
In-Reply-To: <20200612071655.8009-1-xiyou.wangcong@gmail.com>

On Fri, Jun 12, 2020 at 12:16:55AM -0700, Cong Wang wrote:
> genl_family_rcv_msg_attrs_parse() and genl_family_rcv_msg_attrs_free()
> take a boolean parameter to determine whether allocate/free the family
> attrs. This is unnecessary as we can just check family->parallel_ops.
> More importantly, callers would not need to worry about pairing these
> parameters correctly after this patch.
> 
> And this fixes a memory leak, as after commit c36f05559104
> ("genetlink: fix memory leaks in genl_family_rcv_msg_dumpit()")
> we call genl_family_rcv_msg_attrs_parse() for both parallel and
> non-parallel cases.
> 
> Fixes: c36f05559104 ("genetlink: fix memory leaks in genl_family_rcv_msg_dumpit()")
> Reported-by: Ido Schimmel <idosch@idosch.org>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>

Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Tested-by: Ido Schimmel <idosch@mellanox.com>

Thanks!

  reply	other threads:[~2020-06-12 12:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-12  7:16 [Patch net] genetlink: clean up family attributes allocations Cong Wang
2020-06-12 12:31 ` Ido Schimmel [this message]
2020-06-12 21: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=20200612123109.GA22179@splinter \
    --to=idosch@idosch.org \
    --cc=netdev@vger.kernel.org \
    --cc=xiyou.wangcong@gmail.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).