Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 15b99ac17295 ("[PATCH] pcmcia: add return value to _config() functions")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Link: https://lore.kernel.org/r/d8593ae867b24c79063646e36f9b18b0790107cb.1684575975.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Christophe JAILLET and committed by
Jakub Kicinski
640bf95b 5b17a497

+10 -1
+10 -1
drivers/net/ethernet/3com/3c589_cs.c
··· 195 195 { 196 196 struct el3_private *lp; 197 197 struct net_device *dev; 198 + int ret; 198 199 199 200 dev_dbg(&link->dev, "3c589_attach()\n"); 200 201 ··· 219 218 220 219 dev->ethtool_ops = &netdev_ethtool_ops; 221 220 222 - return tc589_config(link); 221 + ret = tc589_config(link); 222 + if (ret) 223 + goto err_free_netdev; 224 + 225 + return 0; 226 + 227 + err_free_netdev: 228 + free_netdev(dev); 229 + return ret; 223 230 } 224 231 225 232 static void tc589_detach(struct pcmcia_device *link)