mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-23 23:50:51 +07:00
bsg: free the request before return error code
[ Upstream commit 0f7b4bc6bb1e57c48ef14f1818df947c1612b206 ]
Free the request rq before returning error code.
Fixes: 972248e911
("scsi: bsg-lib: handle bidi requests without block layer help")
Signed-off-by: Pan Bian <bianpan2016@163.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
a9d9fd5bd2
commit
1c7b7d476e
@ -157,8 +157,10 @@ static int bsg_sg_io(struct request_queue *q, fmode_t mode, void __user *uarg)
|
|||||||
return PTR_ERR(rq);
|
return PTR_ERR(rq);
|
||||||
|
|
||||||
ret = q->bsg_dev.ops->fill_hdr(rq, &hdr, mode);
|
ret = q->bsg_dev.ops->fill_hdr(rq, &hdr, mode);
|
||||||
if (ret)
|
if (ret) {
|
||||||
|
blk_put_request(rq);
|
||||||
return ret;
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
rq->timeout = msecs_to_jiffies(hdr.timeout);
|
rq->timeout = msecs_to_jiffies(hdr.timeout);
|
||||||
if (!rq->timeout)
|
if (!rq->timeout)
|
||||||
|
Loading…
Reference in New Issue
Block a user