Commit 640bf95b authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Jakub Kicinski

3c589_cs: Fix an error handling path in tc589_probe()

Should tc589_config() fail, some resources need to be released as already
done in the remove function.

Fixes: 15b99ac1 ("[PATCH] pcmcia: add return value to _config() functions")
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
Link: https://lore.kernel.org/r/d8593ae867b24c79063646e36f9b18b0790107cb.1684575975.git.christophe.jaillet@wanadoo.frSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 5b17a497
...@@ -195,6 +195,7 @@ static int tc589_probe(struct pcmcia_device *link) ...@@ -195,6 +195,7 @@ static int tc589_probe(struct pcmcia_device *link)
{ {
struct el3_private *lp; struct el3_private *lp;
struct net_device *dev; struct net_device *dev;
int ret;
dev_dbg(&link->dev, "3c589_attach()\n"); dev_dbg(&link->dev, "3c589_attach()\n");
...@@ -218,7 +219,15 @@ static int tc589_probe(struct pcmcia_device *link) ...@@ -218,7 +219,15 @@ static int tc589_probe(struct pcmcia_device *link)
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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment