mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
sbp2: did not clean up after scsi_add_device() failed
If scsi_add_device() at the end of sbp2_start_device() fails, e.g. due to transport errors during SCSI inquiry, sbp2 needs to log out of the device and release all associated resources. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Jody McIntyre <scjody@modernduck.com>
This commit is contained in:
parent
43863eba76
commit
dc3edd5412
1 changed files with 2 additions and 0 deletions
|
@ -960,6 +960,8 @@ alloc_fail:
|
||||||
error = scsi_add_device(scsi_id->scsi_host, 0, scsi_id->ud->id, 0);
|
error = scsi_add_device(scsi_id->scsi_host, 0, scsi_id->ud->id, 0);
|
||||||
if (error) {
|
if (error) {
|
||||||
SBP2_ERR("scsi_add_device failed");
|
SBP2_ERR("scsi_add_device failed");
|
||||||
|
sbp2_logout_device(scsi_id);
|
||||||
|
sbp2_remove_device(scsi_id);
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue