提交 27a9ed3e 编写于 作者: Z Zhang Changzhong 提交者: sanglipeng

can: sja1000_isa: sja1000_isa_probe(): add missing free_sja1000dev()

stable inclusion
from stable-v5.10.158
commit e74746bf0453f3af258d03e448744664c839376b
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7NTXH

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=e74746bf0453f3af258d03e448744664c839376b

--------------------------------

[ Upstream commit 92dfd931 ]

Add the missing free_sja1000dev() before return from
sja1000_isa_probe() in the register_sja1000dev() error handling case.

In addition, remove blanks before goto labels.

Fixes: 2a6ba39a ("can: sja1000: legacy SJA1000 ISA bus driver")
Signed-off-by: NZhang Changzhong <zhangchangzhong@huawei.com>
Link: https://lore.kernel.org/all/1668168521-5540-1-git-send-email-zhangchangzhong@huawei.comSigned-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: Nsanglipeng <sanglipeng1@jd.com>
上级 8ae91f1e
...@@ -202,22 +202,24 @@ static int sja1000_isa_probe(struct platform_device *pdev) ...@@ -202,22 +202,24 @@ static int sja1000_isa_probe(struct platform_device *pdev)
if (err) { if (err) {
dev_err(&pdev->dev, "registering %s failed (err=%d)\n", dev_err(&pdev->dev, "registering %s failed (err=%d)\n",
DRV_NAME, err); DRV_NAME, err);
goto exit_unmap; goto exit_free;
} }
dev_info(&pdev->dev, "%s device registered (reg_base=0x%p, irq=%d)\n", dev_info(&pdev->dev, "%s device registered (reg_base=0x%p, irq=%d)\n",
DRV_NAME, priv->reg_base, dev->irq); DRV_NAME, priv->reg_base, dev->irq);
return 0; return 0;
exit_unmap: exit_free:
free_sja1000dev(dev);
exit_unmap:
if (mem[idx]) if (mem[idx])
iounmap(base); iounmap(base);
exit_release: exit_release:
if (mem[idx]) if (mem[idx])
release_mem_region(mem[idx], iosize); release_mem_region(mem[idx], iosize);
else else
release_region(port[idx], iosize); release_region(port[idx], iosize);
exit: exit:
return err; return err;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册