Re: [PATCH] xdp_rxq_info_user: Replace malloc/memset w/calloc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 12 Jun 2020 03:14:58 -0700
Joe Perches <joe@xxxxxxxxxxx> 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@xxxxxxxxx> wrote:
> >   
> > > Replace malloc/memset with calloc
> > > 
> > > Fixes: 0fca931a6f21 ("samples/bpf: program demonstrating access to xdp_rxq_info")
> > > Signed-off-by: Gaurav Singh <gaurav1086@xxxxxxxxx>  
> > 
> > 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




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux