block/nullb: delete unnecessary memory free
authorShaohua Li <shli@fb.com>
Mon, 28 Aug 2017 20:49:31 +0000 (13:49 -0700)
committerJens Axboe <axboe@kernel.dk>
Mon, 28 Aug 2017 21:06:17 +0000 (15:06 -0600)
Commit 2984c86(nullb: factor disk parameters) has a typo. The
nullb_device allocation/free is done outside of null_add_dev. The commit
accidentally frees the nullb_device in error code path.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/null_blk.c

index 6472135255496d5d4167bfd2d378ec72ca146d6b..3b5cabe374d29948e72ebea8c4b2211299e7956f 100644 (file)
@@ -1909,7 +1909,6 @@ out_cleanup_queues:
 out_free_nullb:
        kfree(nullb);
 out:
-       null_free_dev(dev);
        return rv;
 }