]> git.itanic.dy.fi Git - linux-stable/commit
usbnet: smsc95xx: Clean up unnecessary BUG_ON() upon register access
authorLukas Wunner <lukas@wunner.de>
Fri, 1 Jul 2022 20:47:53 +0000 (22:47 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 4 Jul 2022 09:39:25 +0000 (10:39 +0100)
commit03b3df43ce1f64b2ec6ef8cbcf2006f3938643b2
tree9f58d2ab23fb13af34bf22a6bfd24c0f721c44fb
parent3147242980c5f849978b424cf79dda4fef20716f
usbnet: smsc95xx: Clean up unnecessary BUG_ON() upon register access

smsc95xx_read_reg() and smsc95xx_write_reg() call BUG_ON() if the
struct usbnet pointer passed in is NULL.

The functions have just been amended to dereference the pointer on
entry.  So the kernel now oopses if the pointer is NULL, eliminating
the need for an explicit BUG_ON().

Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/usb/smsc95xx.c