diff --git a/drivers/block/null_blk_main.c b/drivers/block/null_blk_main.c index 83e31b81db3ccf..80d3dcb8722c87 100644 --- a/drivers/block/null_blk_main.c +++ b/drivers/block/null_blk_main.c @@ -1817,6 +1817,7 @@ static int null_add_dev(struct nullb_device *dev) cleanup_queues(nullb); out_free_nullb: kfree(nullb); + dev->nullb = NULL; out: return rv; }