提交 0f7b4bc6 编写于 作者: P Pan Bian 提交者: Jens Axboe

bsg: free the request before return error code

Free the request rq before returning error code.

Fixes: 972248e9 ("scsi: bsg-lib: handle bidi requests without block layer help")
Signed-off-by: NPan Bian <bianpan2016@163.com>
Reviewed-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
上级 faa8e2c4
......@@ -157,8 +157,10 @@ static int bsg_sg_io(struct request_queue *q, fmode_t mode, void __user *uarg)
return PTR_ERR(rq);
ret = q->bsg_dev.ops->fill_hdr(rq, &hdr, mode);
if (ret)
if (ret) {
blk_put_request(rq);
return ret;
}
rq->timeout = msecs_to_jiffies(hdr.timeout);
if (!rq->timeout)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册