Re: [PATCH] staging: vt6656: Fix dereference before NULL check

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

 



On Fri, Apr 25, 2014 at 01:54:51PM +0200, Tobias Klauser wrote:
> pFifoHead is dereferenced before it is checked for NULL which implies it
> can potentially be NULL. Thus move the check before the dereference.
> 
> Found by the coverity scanner, CID 1127221.
> 

pFifoHead is this:

struct vnt_tx_fifo_head *pFifoHead = &tx_buffer->fifo_head;

Even if tx_buffer were NULL, the address of tx_buffer->fifo_head would
be non-NULL.  The NULL test serves no purpose.  If tx_buffer were NULL
we would still get an oops though.  According to smatch, tx_buffer is
never NULL but I haven't verified manually.

regards,
dan carpenter

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux