Re: [PATCH rdma-next 1/4] RDMA/nldev: Use __nlmsg_put instead nlmsg_put

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

 



On Sun, Nov 13, 2022 at 09:19:59AM +0200, Leon Romanovsky wrote:
> On Wed, Nov 09, 2022 at 03:15:30PM -0400, Jason Gunthorpe wrote:
> > On Mon, Nov 07, 2022 at 10:51:33AM +0200, Leon Romanovsky wrote:
> > > From: Or Har-Toov <ohartoov@xxxxxxxxxx>
> > > 
> > > Using nlmsg_put causes static analysis tools to many
> > > false positives of not checking the return value of nlmsg_put.
> > > 
> > > In all uses in nldev.c, payload parameter is 0 so NULL will never
> > > be returned. So let's use __nlmsg_put function to silence the
> > > warnings.
> > 
> > I'd rather just add useless checks for the errors than call a private
> > function like this. Or add some nlmsg_put_no_payload() that can't fail
> 
> This is exactly what __nlmsg_put() means. Function that can't fail.

Er no, it is some internal function. A function that can't fail
wouldn't accept the payload argument at all.

Jason



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux