From: Guenter Roeck <linux@roeck-us.net>
To: "David S . Miller" <davem@davemloft.net>
Cc: linux-usb@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, Guenter Roeck <linux@roeck-us.net>,
"Gustavo A . R . Silva" <garsilva@embeddedor.com>
Subject: [PATCH] usbnet: ipheth: Remove unnecessary NULL pointer check
Date: Tue, 30 Apr 2019 17:35:33 -0700 [thread overview]
Message-ID: <1556670933-755-1-git-send-email-linux@roeck-us.net> (raw)
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>
---
drivers/net/usb/ipheth.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c
index a01a71a7e48d..c247aed2dceb 100644
--- a/drivers/net/usb/ipheth.c
+++ b/drivers/net/usb/ipheth.c
@@ -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;
--
2.7.4
next reply other threads:[~2019-05-01 0:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-01 0:35 Guenter Roeck [this message]
2019-05-04 4:00 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1556670933-755-1-git-send-email-linux@roeck-us.net \
--to=linux@roeck-us.net \
--cc=davem@davemloft.net \
--cc=garsilva@embeddedor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome