null_blk: remove duplicate 0 initialization
authorChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Thu, 20 Jun 2019 04:56:58 +0000 (21:56 -0700)
committerJens Axboe <axboe@kernel.dk>
Thu, 20 Jun 2019 09:18:54 +0000 (03:18 -0600)
In function null_add_dev() struct nullb *nullb member is allocated
using kzalloc_node() which returns 0red memory.

In function setup_queues() which is called from the null_add_dev(), on
successful queue allocation we set the nullb->nr_queues = 0 which is not
needed due to earlier use of kzalloc_node().

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/null_blk_main.c

index 2a4f8bc4f930a9aa5217ebda1e90aa744f309a7c..22303e59a2749a923ac5693fb4a8a3a0d98319d1 100644 (file)
@@ -1489,7 +1489,6 @@ static int setup_queues(struct nullb *nullb)
        if (!nullb->queues)
                return -ENOMEM;
 
-       nullb->nr_queues = 0;
        nullb->queue_depth = nullb->dev->hw_queue_depth;
 
        return 0;