Commit 7b93ca43 authored by Ondrej Zary's avatar Ondrej Zary Committed by Martin K. Petersen

scsi: g_NCR5380: Fix release_region in error handling

When a SW-configurable card is specified but not found, the driver
releases wrong region, causing the following message in kernel log:
Trying to free nonexistent resource <0000000000000000-000000000000000f>

Fix it by assigning base earlier.
Signed-off-by: default avatarOndrej Zary <linux@rainbow-software.org>
Fixes: a8cfbcae ("scsi: g_NCR5380: Stop using scsi_module.c")
Signed-off-by: default avatarFinn Thain <fthain@telegraphics.com.au>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent ee32c909
...@@ -164,12 +164,12 @@ static int generic_NCR5380_init_one(struct scsi_host_template *tpnt, ...@@ -164,12 +164,12 @@ static int generic_NCR5380_init_one(struct scsi_host_template *tpnt,
if (ports[i]) { if (ports[i]) {
/* At this point we have our region reserved */ /* At this point we have our region reserved */
magic_configure(i, 0, magic); /* no IRQ yet */ magic_configure(i, 0, magic); /* no IRQ yet */
outb(0xc0, ports[i] + 9); base = ports[i];
if (inb(ports[i] + 9) != 0x80) { outb(0xc0, base + 9);
if (inb(base + 9) != 0x80) {
ret = -ENODEV; ret = -ENODEV;
goto out_release; goto out_release;
} }
base = ports[i];
port_idx = i; port_idx = i;
} else } else
return -EINVAL; return -EINVAL;
......
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