scsi: bsg-lib: Fix commands without data transfer in bsg_transport_sg_io_fn()
authorChristoph Hellwig <hch@lst.de>
Sat, 31 Jul 2021 07:40:27 +0000 (09:40 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sun, 1 Aug 2021 17:21:40 +0000 (13:21 -0400)
commit659a37844abc00c3dc676bb1faed29c1dacbf59f
treee5ae57652b01a98ab280dd853f8897369b199e10
parent5c0f61377b765e650b1bc85298b79add1148c97f
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: 75ca56409e5b ("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>
block/bsg-lib.c