ioremap balanced with iounmap for drivers/scsi/sun3_vme.c
Subsystems (2)
PATCH 17/36 ioremap balanced with iounmap for drivers/scsi/sun3_vme.c
From: Amol Lad <[email protected]>
ioremap must be balanced by an iounmap and failing to do so can result in a memory leak.
Signed-off-by Amol Lad <[email protected]>
Cc James Bottomley <[email protected]>
Cc "David S. Miller" <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
drivers/scsi/sun3_scsi_vme.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletion(-)
drivers/scsi/sun3_scsi_vme.c renamed from drivers/scsi/sun3_scsi_vme.c~ioremap-balanced-with-iounmap-drivers-scsi-sun3_scsi_vmec +4 -1
@@ -216,8 +216,10 @@ static int sun3scsi_detect(struct scsi_h#endif instance =scsi_register (tpnt,sizeof (struct NCR5380_hostdata )); -if (instance ==NULL ) +if (instance ==NULL ) { +iounmap ((void *)ioaddr);return 0 ; + } default_instance = instance;
@@ -239,6 +241,7 @@ static int sun3scsi_detect(struct scsi_h#else printk ("scsi%d: IRQ%d not free, bailing out\n" , instance->host_no, instance->irq); +iounmap ((void *)ioaddr);return 0 ;#endif }
_