Re: [PATCH] Use bio_endio instead of bio_put in error path of blk_rq_append_bio

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 28/02/18 19:38, Boaz Harrosh wrote:
<>
> Based on v4.15 code feel free to add to your patchset
> where needed
> 

Sorry is what happens when you work on so many Linux versions at
the same time. This one is based on v4.15

> ----
> Don't leak the request if blk_rq_append_bio fails
> 
> Sign-of-by: Boaz Harrosh <ooo@xxxxxxxxxxxxxxx>
> ----
diff --git a/drivers/scsi/osd/osd_initiator.c b/drivers/scsi/osd/osd_initiator.c
index e188771..58782dc 100644
--- a/drivers/scsi/osd/osd_initiator.c
+++ b/drivers/scsi/osd/osd_initiator.c
@@ -1579,8 +1579,10 @@ static struct request *_make_request(struct request_queue *q, bool has_write,
 		struct bio *bounce_bio = bio;
 
 		ret = blk_rq_append_bio(req, &bounce_bio);
-		if (ret)
+		if (ret) {
+			_put_request(req);
 			return ERR_PTR(ret);
+		}
 	}
 
 	return req;





[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux