Re: [PATCH] media: v4l2-subdev: fix some NULL vs IS_ERR() checks

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

 



On Wed, Jun 23, 2021 at 05:34:16AM +0300, Laurent Pinchart wrote:
> 
> Do you think an annotation could still help, by making it explicit in
> headers whether a function returns NULL or an error pointer, thus
> helping developers get it right in the first place ?

Not really.  It wouldn't help with Smatch.  I really think error pointer
bugs are handled pretty well currently.  Sometimes I have seen syzbot
find them before the static checkers but I don't see them affecting
users and production kernels.

There are few other things that Smatch looks for like passing positives,
valid pointers or NULLs to PTR_ERR().  I do wish that when functions
return a mix of negative error codes, 0 and 1 that they had comment
explaining what the 1 means.

regards,
dan carpenter



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux