提交 7c8b1e85 编写于 作者: A Andre Edich 提交者: David S. Miller

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().

Fixes: 2f7ca802 ("net: Add SMSC LAN9500 USB2.0 10/100 ethernet adapter driver")
Signed-off-by: NAndre Edich <andre.edich@microchip.com>
Signed-off-by: NParthiban Veerasooran <Parthiban.Veerasooran@microchip.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 9dc829a1
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册