re: usbnet: fix oops in usbnet_start_xmit

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

Hello Konstantin Khlebnikov,

This is a semi-automatic email about new static checker warnings.

The patch 23ba07991dad: "usbnet: fix oops in usbnet_start_xmit" from 
Nov 7, 2011, leads to the following Smatch complaint:

drivers/net/usb/usbnet.c +1077 usbnet_start_xmit()
	 error: we previously assumed 'skb' could be null (see line 1060)

drivers/net/usb/usbnet.c
  1059	
  1060		if (skb)
                    ^^^
check introduced here.

  1061			skb_tx_timestamp(skb);
  1062	
  1063		// some devices want funky USB-level framing, for
  1064		// win32 driver (usually) and/or hardware quirks
  1065		if (info->tx_fixup) {
  1066			skb = info->tx_fixup (dev, skb, GFP_ATOMIC);
  1067			if (!skb) {
  1068				if (netif_msg_tx_err(dev)) {
  1069					netif_dbg(dev, tx_err, dev->net, "can't tx_fixup skb\n");
  1070					goto drop;
  1071				} else {
  1072					/* cdc_ncm collected packet; waits for more */
  1073					goto not_drop;
  1074				}
  1075			}
  1076		}
  1077		length = skb->len;
                         ^^^^^^^^
dereference without checking.

  1078	
  1079		if (!(urb = usb_alloc_urb (0, GFP_ATOMIC))) {

regards,
dan carpenter

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


[Linux Kernel Discussion]     [Ethernet Bridging]     [Linux Wireless Networking]     [Linux Bluetooth Networking]     [Linux Networking Users]     [VLAN]     [Git]     [IETF Annouce]     [Linux Assembly]     [Security]     [Bugtraq]     [Photo]     [Singles Social Networking]     [Yosemite Information]     [MIPS Linux]     [ARM Linux Kernel]     [ARM Linux]     [Linux Virtualization]     [Linux Security]     [Linux IDE]     [Linux RAID]     [Linux SCSI]     [Free Dating]

Add to Google Powered by Linux