[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0b82952a6e0b4a05c93f4d18b3d0b2f43b61ab98.camel@perches.com>
Date: Fri, 12 Jun 2020 08:19:10 -0700
From: Joe Perches <joe@...ches.com>
To: Jesper Dangaard Brouer <jbrouer@...hat.com>
Cc: Gaurav Singh <gaurav1086@...il.com>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Jesper Dangaard Brouer <hawk@...nel.org>,
John Fastabend <john.fastabend@...il.com>,
Martin KaFai Lau <kafai@...com>,
Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
Andrii Nakryiko <andriin@...com>,
KP Singh <kpsingh@...omium.org>,
"open list:XDP (eXpress Data Path)" <netdev@...r.kernel.org>,
"open list:XDP (eXpress Data Path)" <bpf@...r.kernel.org>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] xdp_rxq_info_user: Replace malloc/memset w/calloc
On Fri, 2020-06-12 at 14:05 +0200, Jesper Dangaard Brouer wrote:
> On Fri, 12 Jun 2020 03:14:58 -0700
> Joe Perches <joe@...ches.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@...il.com> wrote:
> > >
> > > > Replace malloc/memset with calloc
> > > >
> > > > Fixes: 0fca931a6f21 ("samples/bpf: program demonstrating access to xdp_rxq_info")
> > > > Signed-off-by: Gaurav Singh <gaurav1086@...il.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.
I didn't review the code at all, just the commit message,
It's important to have commit messages that describe the
defect being corrected too.
Otherwise, a simple malloc/memset(0) vs zalloc equivalent
is not actually a defect.
Powered by blists - more mailing lists