{
struct el3_private *lp;
struct net_device *dev;
{
struct el3_private *lp;
struct net_device *dev;
dev_dbg(&link->dev, "3c589_attach()\n");
dev_dbg(&link->dev, "3c589_attach()\n");
dev->ethtool_ops = &netdev_ethtool_ops;
dev->ethtool_ops = &netdev_ethtool_ops;
- return tc589_config(link);
+ ret = tc589_config(link);
+ if (ret)
+ goto err_free_netdev;
+
+ return 0;
+
+err_free_netdev:
+ free_netdev(dev);
+ return ret;
}
static void tc589_detach(struct pcmcia_device *link)
}
static void tc589_detach(struct pcmcia_device *link)