mirror of
https://github.com/torvalds/linux
synced 2024-10-15 15:59:15 +00:00
scsi: bsg-lib: Fix commands without data transfer in bsg_transport_sg_io_fn()
Set ret to 0 after the initial permission checks to avoid leaking -EPERM
for commands without data transfer.
Link: https://lore.kernel.org/r/20210731074027.1185545-3-hch@lst.de
Fixes: 75ca56409e
("scsi: bsg: Move the whole request execution into the SCSI/transport handlers")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
5c0f61377b
commit
659a37844a
|
@ -72,6 +72,7 @@ static int bsg_transport_sg_io_fn(struct request_queue *q, struct sg_io_v4 *hdr,
|
||||||
job->bidi_bio = NULL;
|
job->bidi_bio = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ret = 0;
|
||||||
if (hdr->dout_xfer_len) {
|
if (hdr->dout_xfer_len) {
|
||||||
ret = blk_rq_map_user(rq->q, rq, NULL, uptr64(hdr->dout_xferp),
|
ret = blk_rq_map_user(rq->q, rq, NULL, uptr64(hdr->dout_xferp),
|
||||||
hdr->dout_xfer_len, GFP_KERNEL);
|
hdr->dout_xfer_len, GFP_KERNEL);
|
||||||
|
|
Loading…
Reference in a new issue