Commit 62ec89e7 authored by Zhang Changzhong's avatar Zhang Changzhong Committed by Marc Kleine-Budde

can: cc770: cc770_isa_probe(): add missing free_cc770dev()

Add the missing free_cc770dev() before return from cc770_isa_probe()
in the register_cc770dev() error handling case.

In addition, remove blanks before goto labels.

Fixes: 7e02e543 ("can: cc770: legacy CC770 ISA bus driver")
Signed-off-by: default avatarZhang Changzhong <zhangchangzhong@huawei.com>
Link: https://lore.kernel.org/all/1668168557-6024-1-git-send-email-zhangchangzhong@huawei.comSigned-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent 92dfd931
...@@ -264,22 +264,24 @@ static int cc770_isa_probe(struct platform_device *pdev) ...@@ -264,22 +264,24 @@ static int cc770_isa_probe(struct platform_device *pdev)
if (err) { if (err) {
dev_err(&pdev->dev, dev_err(&pdev->dev,
"couldn't register device (err=%d)\n", err); "couldn't register device (err=%d)\n", err);
goto exit_unmap; goto exit_free;
} }
dev_info(&pdev->dev, "device registered (reg_base=0x%p, irq=%d)\n", dev_info(&pdev->dev, "device registered (reg_base=0x%p, irq=%d)\n",
priv->reg_base, dev->irq); priv->reg_base, dev->irq);
return 0; return 0;
exit_unmap: exit_free:
free_cc770dev(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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment