]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
skd: Initialize skd_special_context.req.n_sg to one
authorBart Van Assche <bart.vanassche@wdc.com>
Thu, 17 Aug 2017 20:13:25 +0000 (13:13 -0700)
committerJens Axboe <axboe@kernel.dk>
Fri, 18 Aug 2017 14:45:29 +0000 (08:45 -0600)
The debug code in skd_send_special_fitmsg() assumes that req.n_sg
represents the number of S/G descriptors. However, skd_construct()
initializes that member variable to zero. Set req.n_sg to one such
that the debugging code in skd_send_special_fitmsg() works as
expected.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/skd_main.c

index c7f531e99ede37cb5cc390c2c66c8c053ee41311..392c898d86e2b4ddde208cd795d5fd737f88ee33 100644 (file)
@@ -1050,6 +1050,7 @@ static int skd_format_internal_skspcl(struct skd_device *skdev)
        memset(scsi, 0, sizeof(*scsi));
        dma_address = skspcl->req.sksg_dma_address;
        scsi->hdr.sg_list_dma_address = cpu_to_be64(dma_address);
+       skspcl->req.n_sg = 1;
        sgd->control = FIT_SGD_CONTROL_LAST;
        sgd->byte_count = 0;
        sgd->host_side_addr = skspcl->db_dma_address;