Re: [PATCH] usbnet: ipheth: Remove unnecessary NULL pointer check

From: David Miller
Date: Sat May 04 2019 - 00:00:42 EST


From: Guenter Roeck <linux@xxxxxxxxxxxx>
Date: Tue, 30 Apr 2019 17:35:33 -0700

> 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@xxxxxxxxxxxxxx>
> Signed-off-by: Guenter Roeck <linux@xxxxxxxxxxxx>

Applied to net-next.