* [patch] usbnet: smsc95xx: silence an uninitialized variable warning
@ 2016-05-04 6:22 Dan Carpenter
2016-05-04 21:00 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2016-05-04 6:22 UTC (permalink / raw)
To: Steve Glendinning
Cc: netdev-u79uwXL29TY76Z2rM5mHXA, linux-usb-u79uwXL29TY76Z2rM5mHXA
If the call to fn() fails then "buf" is uninitialized. Just return the
error code in that case.
Signed-off-by: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index 2edc2bc..d9d2806 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -92,9 +92,11 @@ static int __must_check __smsc95xx_read_reg(struct usbnet *dev, u32 index,
ret = fn(dev, USB_VENDOR_REQUEST_READ_REGISTER, USB_DIR_IN
| USB_TYPE_VENDOR | USB_RECIP_DEVICE,
0, index, &buf, 4);
- if (unlikely(ret < 0))
+ if (unlikely(ret < 0)) {
netdev_warn(dev->net, "Failed to read reg index 0x%08x: %d\n",
index, ret);
+ return ret;
+ }
le32_to_cpus(&buf);
*data = buf;
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch] usbnet: smsc95xx: silence an uninitialized variable warning
2016-05-04 6:22 [patch] usbnet: smsc95xx: silence an uninitialized variable warning Dan Carpenter
@ 2016-05-04 21:00 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-05-04 21:00 UTC (permalink / raw)
To: dan.carpenter; +Cc: steve.glendinning, netdev, linux-usb
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Wed, 4 May 2016 09:22:01 +0300
> If the call to fn() fails then "buf" is uninitialized. Just return the
> error code in that case.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Applied.
Please, in the future, use a consistent subsystem prefixing scheme. In these
two patches you used "x/y:"" and "x: y:"
Thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-05-04 21:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-04 6:22 [patch] usbnet: smsc95xx: silence an uninitialized variable warning Dan Carpenter
2016-05-04 21:00 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).