]> git.baikalelectronics.ru Git - kernel.git/commit
net: usb: asix: Fix crash on skb alloc failure
authorDavid B. Robins <linux@davidrobins.net>
Wed, 30 Sep 2015 20:20:04 +0000 (16:20 -0400)
committerDavid S. Miller <davem@davemloft.net>
Mon, 5 Oct 2015 10:31:27 +0000 (03:31 -0700)
commit776a4b7b886256ad9e22f24f429b54288aa044c1
tree6d816a477b38af6e4cce7cda214fc17589c0b57a
parent750a3d99ec65d0537783848a3c717ba486e8dbeb
net: usb: asix: Fix crash on skb alloc failure

If asix_rx_fixup_internal() fails to allocate rx->ax_skb, it will return
but not clear rx->size. rx points to driver private data. A later call
assumes that nonzero size means ax_skb was allocated and passes a null
ax_skb to skb_put. Changed allocation failure return to clear size first.

Found testing board with AX88772B devices.

Signed-off-by: David B. Robins <linux@davidrobins.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/usb/asix_common.c