提交 e61723a8 编写于 作者: C Christophe JAILLET 提交者: Zheng Zengkai

scsi: zorro7xx: Fix a resource leak in zorro7xx_remove_one()

stable inclusion
from stable-v5.10.111
commit c5f77b595379b5191316edd365a542f8b1526066
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5GL1Z

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

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

[ Upstream commit 16ed828b ]

The error handling path of the probe releases a resource that is not freed
in the remove function. In some cases, a ioremap() must be undone.

Add the missing iounmap() call in the remove function.

Link: https://lore.kernel.org/r/247066a3104d25f9a05de8b3270fc3c848763bcc.1647673264.git.christophe.jaillet@wanadoo.fr
Fixes: 45804fbb ("[SCSI] 53c700: Amiga Zorro NCR53c710 SCSI")
Reviewed-by: NGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Reviewed-by: NWei Li <liwei391@huawei.com>
上级 4650d638
...@@ -159,6 +159,8 @@ static void zorro7xx_remove_one(struct zorro_dev *z) ...@@ -159,6 +159,8 @@ static void zorro7xx_remove_one(struct zorro_dev *z)
scsi_remove_host(host); scsi_remove_host(host);
NCR_700_release(host); NCR_700_release(host);
if (host->base > 0x01000000)
iounmap(hostdata->base);
kfree(hostdata); kfree(hostdata);
free_irq(host->irq, host); free_irq(host->irq, host);
zorro_release_device(z); zorro_release_device(z);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册