From: Matthew Wilcox Date: Wed, 15 Aug 2007 18:56:54 +0000 (-0600) Subject: [SCSI] simscsi: Free scsi host on error X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=a60ebc52cbfafc291c6b0b89e41ecaf3685c8e2a;p=mv-sheeva.git [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 Signed-off-by: James Bottomley --- diff --git a/arch/ia64/hp/sim/simscsi.c b/arch/ia64/hp/sim/simscsi.c index e62694f8ef7..a43e1e1822a 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; }