RE: [PATCH] MUSB: Fix Null Pointer dereference issues in musb gadget code

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

 



On Wed, 24 Jun 2009, Maulik wrote:

> Hi David, Alan,
> 
> These issues were discovered while running klockworks which is a code review
> tool that detects coding mistakes. 

Then perhaps the tool detected some false positives?

> I haven't seen an obvious crash due to this.
> 
> I agree with your comments.
> 
> Do you recommend adding such checks before and after calling container_of()
> to make the driver more robust? This would mean checking for all arguments
> of functions and validating them before using them. This might be an
> overhead.

I recommend not adding these checks (the ones I singled out earlier) at
all, and auditing the code to make sure that the checks aren't needed.  
As you say, validating the arguments of function calls.

This need not be an overhead.  Probably in all cases you will be able
to show from static analysis that the arguments cannot be NULL.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux