mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-03 19:24:02 +08:00
[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>
This commit is contained in:
parent
c131993b4c
commit
a60ebc52cb
@ -373,8 +373,13 @@ simscsi_init(void)
|
|||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
error = scsi_add_host(host, NULL);
|
error = scsi_add_host(host, NULL);
|
||||||
if (!error)
|
if (error)
|
||||||
|
goto free_host;
|
||||||
scsi_scan_host(host);
|
scsi_scan_host(host);
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
free_host:
|
||||||
|
scsi_host_put(host);
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user