projects
/
firefly-linux-kernel-4.4.55.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c131993
)
[SCSI] simscsi: Free scsi host on error
author
Matthew Wilcox
<matthew@wil.cx>
Wed, 15 Aug 2007 18:56:54 +0000
(12:56 -0600)
committer
James Bottomley
<jejb@mulgrave.localdomain>
Fri, 12 Oct 2007 18:51:29 +0000
(14:51 -0400)
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>
arch/ia64/hp/sim/simscsi.c
patch
|
blob
|
history
diff --git
a/arch/ia64/hp/sim/simscsi.c
b/arch/ia64/hp/sim/simscsi.c
index e62694f8ef75d8b6b46605e6c9924d4ba7bcf898..a43e1e1822ad04b830add4d758a0a9cc423b0923 100644
(file)
--- 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;
}