diff options
author | Lukas Wunner <lukas@wunner.de> | 2022-07-01 22:47:53 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-07-04 10:39:25 +0100 |
commit | 03b3df43ce1f64b2ec6ef8cbcf2006f3938643b2 (patch) | |
tree | 9f58d2ab23fb13af34bf22a6bfd24c0f721c44fb /drivers/net/usb | |
parent | 3147242980c5f849978b424cf79dda4fef20716f (diff) | |
download | linux-03b3df43ce1f64b2ec6ef8cbcf2006f3938643b2.tar.bz2 |
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>
Diffstat (limited to 'drivers/net/usb')
-rw-r--r-- | drivers/net/usb/smsc95xx.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c index 5458629cf694..bfb58c91db04 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c @@ -86,8 +86,6 @@ static int __must_check smsc95xx_read_reg(struct usbnet *dev, u32 index, int ret; int (*fn)(struct usbnet *, u8, u8, u16, u16, void *, u16); - BUG_ON(!dev); - if (current != pdata->pm_task) fn = usbnet_read_cmd; else @@ -117,8 +115,6 @@ static int __must_check smsc95xx_write_reg(struct usbnet *dev, u32 index, int ret; int (*fn)(struct usbnet *, u8, u8, u16, u16, const void *, u16); - BUG_ON(!dev); - if (current != pdata->pm_task) fn = usbnet_write_cmd; else |