]> git.baikalelectronics.ru Git - kernel.git/commit
usbnet: avoid integer overflow in start_xmit
authorJason A. Donenfeld <Jason@zx2c4.com>
Wed, 6 May 2015 13:09:40 +0000 (15:09 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sat, 9 May 2015 20:46:18 +0000 (16:46 -0400)
commit932255b6e75bc6436f32b6242711cd01e0ac2a56
treeebfc4cd7b8b50fb768acd181bdeee24badfb9bbc
parentdd4dba339312f7527e704900c0cc927302b23d44
usbnet: avoid integer overflow in start_xmit

transfer_buffer_length is of type u32. It's therefore wrong to assign it
to a signed integer. This patch avoids the overflow.

It's worth noting that entry->length here is a long; perhaps it would be
beneficial at somepoint to change this to be unsigned as well, if
nothing else relies on its signedness for error conditions or the like.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/usb/usbnet.c