Commit 2d827a77 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by He Yujie
Browse files

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

stable inclusion
from stable-v4.19.238
commit db863ab2baf058ed05c7b723612e3c40c9dd6885
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IBP3RP
CVE: CVE-2022-49095

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

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

[ 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: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarHe Yujie <coka.heyujie@huawei.com>
parent d734d6bb
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -158,6 +158,8 @@ static void zorro7xx_remove_one(struct zorro_dev *z)
	scsi_remove_host(host);

	NCR_700_release(host);
	if (host->base > 0x01000000)
		iounmap(hostdata->base);
	kfree(hostdata);
	free_irq(host->irq, host);
	zorro_release_device(z);