bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jesper Dangaard Brouer <jbrouer@redhat.com>
To: Joe Perches <joe@perches.com>
Cc: Gaurav Singh <gaurav1086@gmail.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Jesper Dangaard Brouer <hawk@kernel.org>,
	John Fastabend <john.fastabend@gmail.com>,
	Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>,
	Yonghong Song <yhs@fb.com>, Andrii Nakryiko <andriin@fb.com>,
	KP Singh <kpsingh@chromium.org>,
	"open list:XDP (eXpress Data Path)" <netdev@vger.kernel.org>,
	"open list:XDP (eXpress Data Path)" <bpf@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] xdp_rxq_info_user: Replace malloc/memset w/calloc
Date: Fri, 12 Jun 2020 14:05:20 +0200	[thread overview]
Message-ID: <20200612140520.1e3c0461@carbon> (raw)
In-Reply-To: <427be84b1154978342ef861f1f4634c914d03a94.camel@perches.com>

On Fri, 12 Jun 2020 03:14:58 -0700
Joe Perches <joe@perches.com> wrote:

> On Fri, 2020-06-12 at 08:42 +0200, Jesper Dangaard Brouer wrote:
> > On Thu, 11 Jun 2020 20:36:40 -0400
> > Gaurav Singh <gaurav1086@gmail.com> wrote:
> >   
> > > Replace malloc/memset with calloc
> > > 
> > > Fixes: 0fca931a6f21 ("samples/bpf: program demonstrating access to xdp_rxq_info")
> > > Signed-off-by: Gaurav Singh <gaurav1086@gmail.com>  
> > 
> > Above is the correct use of Fixes + Signed-off-by.
> > 
> > Now you need to update/improve the description, to also
> > mention/describe that this also solves the bug you found.  
> 
> This is not a fix, it's a conversion of one
> correct code to a shorter one.

Read the code again Joe.  There is a bug in the code that gets removed,
as it runs memset on the memory before checking if it was NULL.

IHMO this proves why is it is necessary to mention in the commit
message, as you didn't notice the bug in your code review.

-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  LinkedIn: http://www.linkedin.com/in/brouer


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

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-11 15:02 [PATCH] xdp_rxq_info_user: Replace malloc/memset w/calloc Gaurav Singh
2020-06-11 18:01 ` Jesper Dangaard Brouer
2020-06-12  0:26 ` Gaurav Singh
2020-06-12  0:36 ` Gaurav Singh
2020-06-12  6:42   ` Jesper Dangaard Brouer
2020-06-12 10:14     ` Joe Perches
2020-06-12 12:05       ` Jesper Dangaard Brouer [this message]
2020-06-12 15:19         ` Joe Perches
2020-06-12 12:06       ` Toke Høiland-Jørgensen
2020-06-12 18:53 ` [PATCH] xdp_rxq_info_user: Fix null pointer dereference. Replace malloc/memset with calloc Gaurav Singh
2020-06-12 20:20   ` Jesper Dangaard Brouer
2020-06-12 22:58     ` John Fastabend

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=20200612140520.1e3c0461@carbon \
    --to=jbrouer@redhat.com \
    --cc=andriin@fb.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=gaurav1086@gmail.com \
    --cc=hawk@kernel.org \
    --cc=joe@perches.com \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kpsingh@chromium.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=songliubraving@fb.com \
    --cc=yhs@fb.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).