mg_disk: fix error path in mg_probe()
authorBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Tue, 28 Jun 2016 13:42:41 +0000 (15:42 +0200)
committerJens Axboe <axboe@fb.com>
Tue, 28 Jun 2016 17:01:27 +0000 (11:01 -0600)
MG_DISK_MAJ is defined as 0 so dynamic block major number
allocation is used by the driver and the assigned major
number is stored in host->major.  This patch fixes error
path in mg_probe() to use host->major instead of using
MG_DISK_MAJ.

Cc: unsik Kim <donari75@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/block/mg_disk.c

index 1ee391846e0ba5da4601bbfee266d38cd40929ba..e937fcf717690fa5a6ec2d4e7915908fbe001836 100644 (file)
@@ -1015,7 +1015,7 @@ probe_err_7:
 probe_err_6:
        blk_cleanup_queue(host->breq);
 probe_err_5:
-       unregister_blkdev(MG_DISK_MAJ, MG_DISK_NAME);
+       unregister_blkdev(host->major, MG_DISK_NAME);
 probe_err_4:
        if (!prv_data->use_polling)
                free_irq(host->irq, host);