mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 04:01:48 -04:00
scsi: target: pscsi: Clean up after failure in pscsi_map_sg()
[ Upstream commit 36fa766faa0c822c860e636fe82b1affcd022974 ] If pscsi_map_sg() fails, make sure to drop references to already allocated bios. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Lee Duncan <[email protected]> Signed-off-by: Martin Wilck <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
This commit is contained in:
parent
e2db0e6613
commit
9b872bac19
1 changed files with 8 additions and 0 deletions
|
|
@ -939,6 +939,14 @@ new_bio:
|
|||
|
||||
return 0;
|
||||
fail:
|
||||
if (bio)
|
||||
bio_put(bio);
|
||||
while (req->bio) {
|
||||
bio = req->bio;
|
||||
req->bio = bio->bi_next;
|
||||
bio_put(bio);
|
||||
}
|
||||
req->biotail = NULL;
|
||||
return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue