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 <o...@electrozaur.com>
> ----
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;


Reply via email to