diff options
author | Luis Chamberlain | 2021-09-27 15:01:48 -0700 |
---|---|---|
committer | Jens Axboe | 2021-10-18 14:41:36 -0600 |
commit | 4a32e1cdb745ea9f66358810b0ce85698033f57e (patch) | |
tree | 8e8c945d91a2ea1265dfcf9984e2e6e7f3a40afb | |
parent | 3dfdd5f333bf16ec5057d508a574a3302ed84cfa (diff) |
mtip32xx: add error handling support for add_disk()
We never checked for errors on add_disk() as this function
returned void. Now that this is fixed, use the shiny new
error handling.
The read_capacity_error error label already does what we need,
so just re-use that.
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r-- | drivers/block/mtip32xx/mtip32xx.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c index 901855717cb5..d0b40309f47e 100644 --- a/drivers/block/mtip32xx/mtip32xx.c +++ b/drivers/block/mtip32xx/mtip32xx.c @@ -3633,7 +3633,9 @@ skip_create_disk: set_capacity(dd->disk, capacity); /* Enable the block device and add it to /dev */ - device_add_disk(&dd->pdev->dev, dd->disk, mtip_disk_attr_groups); + rv = device_add_disk(&dd->pdev->dev, dd->disk, mtip_disk_attr_groups); + if (rv) + goto read_capacity_error; if (dd->mtip_svc_handler) { set_bit(MTIP_DDF_INIT_DONE_BIT, &dd->dd_flag); |