From 7959341099f191424a255456b1cb0162e1bb7f70 Mon Sep 17 00:00:00 2001 From: Rohith Kollalsi Date: Fri, 3 Jul 2020 15:04:01 +0530 Subject: [PATCH] net: usb: Initialize retval with zero as it might be used uninitialized If at the start of usbnet_start_xmit function sk_buff is null then there is a chance that retval could be used uninitialized. To avoid such scenario initialize retval with zero. Change-Id: I2d5b68075338f7d19b6bc76a4ce7cdbe422daadb Signed-off-by: Rohith Kollalsi --- drivers/net/usb/usbnet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index 60db6cb7de8f..250cd81985e6 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c @@ -1364,7 +1364,7 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb, struct skb_data *entry; struct driver_info *info = dev->driver_info; unsigned long flags; - int retval; + int retval = 0; if (skb) skb_tx_timestamp(skb);