]> git.baikalelectronics.ru Git - kernel.git/commit
usbnet: ipheth: fix potential null pointer dereference in ipheth_carrier_set
authorGustavo A. R. Silva <garsilva@embeddedor.com>
Fri, 17 Nov 2017 20:02:09 +0000 (14:02 -0600)
committerDavid S. Miller <davem@davemloft.net>
Sun, 19 Nov 2017 03:23:57 +0000 (12:23 +0900)
commit61c59355e0154a938b28710dfa6c1d8be2ddcefa
tree965c9f92f32d6d69c92e60e1289f0274cbc1085b
parent981542c526ecd846920bc500e9989da906ee9fb9
usbnet: ipheth: fix potential null pointer dereference in ipheth_carrier_set

_dev_ is being dereferenced before it is null checked, hence there
is a potential null pointer dereference.

Fix this by moving the pointer dereference after _dev_ has been null
checked.

Addresses-Coverity-ID: 1462020
Fixes: bb1b40c7cb86 ("usbnet: ipheth: prevent TX queue timeouts when device not ready")
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/usb/ipheth.c