Skip to content

Commit

Permalink
usbnet: ipheth: Remove unnecessary NULL pointer check
Browse files Browse the repository at this point in the history
ipheth_carrier_set() is called from two locations. In
ipheth_carrier_check_work(), its parameter 'dev' is set with
container_of(work, ...) and can not be NULL. In ipheth_open(),
dev is extracted from netdev_priv(net) and dereferenced before
the call to ipheth_carrier_set(). The NULL pointer check of dev
in ipheth_carrier_set() is therefore unnecessary and can be removed.

Cc: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Guenter Roeck authored and David S. Miller committed May 4, 2019
1 parent a27415d commit e28441e
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions drivers/net/usb/ipheth.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,6 @@ static int ipheth_carrier_set(struct ipheth_device *dev)
struct usb_device *udev;
int retval;

if (!dev)
return 0;
if (!dev->confirmed_pairing)
return 0;

Expand Down

0 comments on commit e28441e

Please sign in to comment.