skd: Fix size argument in skd_free_skcomp()
authorBart Van Assche <bart.vanassche@wdc.com>
Thu, 17 Aug 2017 20:13:03 +0000 (13:13 -0700)
committerJens Axboe <axboe@kernel.dk>
Fri, 18 Aug 2017 14:45:29 +0000 (08:45 -0600)
Pass the correct size to pci_free_consistent() in skd_free_skcomp().

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 53090a10150f8af9345d4d48ed4583320876f284..ab344bfa91c9d24775727843c8e0046590e3a675 100644 (file)
@@ -4252,14 +4252,9 @@ err_out:
 
 static void skd_free_skcomp(struct skd_device *skdev)
 {
-       if (skdev->skcomp_table != NULL) {
-               u32 nbytes;
-
-               nbytes = sizeof(skdev->skcomp_table[0]) *
-                        SKD_N_COMPLETION_ENTRY;
-               pci_free_consistent(skdev->pdev, nbytes,
+       if (skdev->skcomp_table)
+               pci_free_consistent(skdev->pdev, SKD_SKCOMP_SIZE,
                                    skdev->skcomp_table, skdev->cq_dma_address);
-       }
 
        skdev->skcomp_table = NULL;
        skdev->cq_dma_address = 0;