re: net: Add ops->ndo_xmit_flush()

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

 



Hello David S. Miller,

The patch 4798248e4e02: "net: Add ops->ndo_xmit_flush()" from Aug 22,
2014, leads to the following static checker warning:

	drivers/usb/gadget/function/f_ncm.c:1104 ncm_tx_tasklet()
	error: NULL dereference inside function.

drivers/usb/gadget/function/f_ncm.c
 1094  static void ncm_tx_tasklet(unsigned long data)
  1095  {
  1096          struct f_ncm    *ncm = (void *)data;
  1097  
  1098          if (ncm->timer_stopping)
  1099                  return;
  1100  
  1101          /* Only send if data is available. */
  1102          if (ncm->skb_tx_data) {
  1103                  ncm->timer_force_tx = true;
  1104                  netdev_start_xmit(NULL, ncm->netdev);
                                          ^^^^
You can't pass a NULL skb to netdev_start_xmit() or it leads to a NULL
dereference when we set "skb->xmit_more = 0;" in __netdev_start_xmit().

  1105                  ncm->timer_force_tx = false;
  1106          }
  1107  }

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