Skip to contentSkip to conversation

smsc95xx: check return value of smsc95xx_reset

PATCH Superseded [email protected] 2 participants 2 messages Jun 29, 2020 – Jun 30, 2020

Subsystems (4)

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/8 smsc95xx: check return value of smsc95xx_reset

The return value of the function smsc95xx_reset() must be checked to avoid returning false success from the function smsc95xx_bind().

Signed-off-by Parthiban Veerasooran <

[email protected]>

---
 drivers/net/usb/smsc95xx.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/net/usb/smsc95xx.c +0 -0
index 3cf4dc3433f9..eb404bb74e18 100644
@@ -1287,6 +1287,8 @@ static int smsc95xx_bind(struct usbnet *dev,

struct usb_interface *intf)

/* Init all registers */
ret = smsc95xx_reset(dev);
+ if (ret)
+ goto free_pdata;

/* detect device revision as different features may be
available */
ret = smsc95xx_read_reg(dev, ID_REV, &val);
@@ -1317,6 +1319,10 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf)
schedule_delayed_work(&pdata->carrier_check,
CARRIER_CHECK_DELAY);

return 0;
+
+free_pdata:
+ kfree(pdata);
+ return ret;
}

static void smsc95xx_unbind(struct usbnet *dev, struct usb_interface
*intf)

#1 lore raw
Quoted 2 lines · On Mon, Jun 29, 2020 at 01:10:47PM +0000, [email protected] wrote:

The return value of the function smsc95xx_reset() must be checked to avoid returning false success from the function smsc95xx_bind().

Hi Andre

This and the next patch look like fixes. They should be for the net tree, and have a Fixes: tag added.

Andrew