bsg_map_hdr always calls blk_rq_map_user so commands without data transfer fail. This is against the bsg branch in the block tree. Signed-off-by: FUJITA Tomonori <fujita.tomonori@xxxxxxxxxxxxx> --- block/bsg.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/block/bsg.c b/block/bsg.c index 5d23f97..65729fd 100644 --- a/block/bsg.c +++ b/block/bsg.c @@ -301,7 +301,7 @@ bsg_map_hdr(struct bsg_device *bd, int r return ERR_PTR(ret); } - if (!hdr->iovec_count) { + if (!hdr->iovec_count && hdr->dxfer_len) { ret = blk_rq_map_user(q, rq, hdr->dxferp, hdr->dxfer_len); if (ret) goto out; -- 1.4.1.1 - To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html