[smatch stuff] USB net2272: potential NULL dereference

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

 



Hi hi,

Smatch prints a warning about the new net2272 driver.

drivers/usb/gadget/net2272.c +1584 net2272_handle_dma(34)
	error: potential null derefence 'req'.

  1581          /* device-to-host transfer completed */
  1582          if (ep->is_in) {
  1583                  /* validate a short packet or zlp if necessary */
  1584                  if ((req->req.length % ep->ep.maxpacket != 0) ||
                             ^^^^^
	Smatch complains that "req" can be NULL here.  It is NULL if
	the ep->queue is empty above.

  1585                                  req->req.zero)
  1586                          set_fifo_bytecount(ep, 0);
  1587  
  1588                  net2272_done(ep, req, 0);
  1589                  if (!list_empty(&ep->queue)) {
                             ^^^^^^^^^^^^^^^^^^^^^
	And it looks like the ep->queue can be NULL down this path.

  1590                          req = list_entry(ep->queue.next,

regards,
dan carpenter
--
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