diff options
author | Ondrej Zary <linux@rainbow-software.org> | 2016-11-11 10:00:20 +1100 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2016-11-12 10:42:44 -0500 |
commit | 7b93ca43b7e21fbe6fb1a6f4ecce4a2f70f424a0 (patch) | |
tree | ada0f4fb1212e536b3202bfdd76b1cc9b3bd917f /drivers/scsi/g_NCR5380.c | |
parent | ee32c9098f2eff12c0e020aac2acade8250c80e4 (diff) | |
download | linux-7b93ca43b7e21fbe6fb1a6f4ecce4a2f70f424a0.tar.gz linux-7b93ca43b7e21fbe6fb1a6f4ecce4a2f70f424a0.tar.bz2 linux-7b93ca43b7e21fbe6fb1a6f4ecce4a2f70f424a0.zip |
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: Ondrej Zary <linux@rainbow-software.org>
Fixes: a8cfbcaec0c1 ("scsi: g_NCR5380: Stop using scsi_module.c")
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/g_NCR5380.c')
-rw-r--r-- | drivers/scsi/g_NCR5380.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c index 7299ad9889c9..de5147a8c959 100644 --- a/drivers/scsi/g_NCR5380.c +++ b/drivers/scsi/g_NCR5380.c @@ -164,12 +164,12 @@ static int generic_NCR5380_init_one(struct scsi_host_template *tpnt, if (ports[i]) { /* At this point we have our region reserved */ magic_configure(i, 0, magic); /* no IRQ yet */ - outb(0xc0, ports[i] + 9); - if (inb(ports[i] + 9) != 0x80) { + base = ports[i]; + outb(0xc0, base + 9); + if (inb(base + 9) != 0x80) { ret = -ENODEV; goto out_release; } - base = ports[i]; port_idx = i; } else return -EINVAL; |