summaryrefslogtreecommitdiffstats
path: root/arch/ia64/hp/sim/simscsi.c
diff options
context:
space:
mode:
authorMatthew Wilcox <matthew@wil.cx>2007-08-15 20:56:54 +0200
committerJames Bottomley <jejb@mulgrave.localdomain>2007-10-12 20:51:29 +0200
commita60ebc52cbfafc291c6b0b89e41ecaf3685c8e2a (patch)
tree55b512e8de7ac38df5115b854890d82344070633 /arch/ia64/hp/sim/simscsi.c
parent[SCSI] qlogicfas: Close narrow race in release (diff)
downloadlinux-a60ebc52cbfafc291c6b0b89e41ecaf3685c8e2a.tar.xz
linux-a60ebc52cbfafc291c6b0b89e41ecaf3685c8e2a.zip
[SCSI] simscsi: Free scsi host on error
If scsi_add_host returned an error, the host would never be freed. We need to call scsi_host_put() if an error happens. Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'arch/ia64/hp/sim/simscsi.c')
-rw-r--r--arch/ia64/hp/sim/simscsi.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/ia64/hp/sim/simscsi.c b/arch/ia64/hp/sim/simscsi.c
index e62694f8ef75..a43e1e1822ad 100644
--- a/arch/ia64/hp/sim/simscsi.c
+++ b/arch/ia64/hp/sim/simscsi.c
@@ -373,8 +373,13 @@ simscsi_init(void)
return -ENOMEM;
error = scsi_add_host(host, NULL);
- if (!error)
- scsi_scan_host(host);
+ if (error)
+ goto free_host;
+ scsi_scan_host(host);
+ return 0;
+
+ free_host:
+ scsi_host_put(host);
return error;
}