diff options
author | Luis Chamberlain <mcgrof@kernel.org> | 2021-11-04 02:04:27 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-11-04 14:48:49 +0300 |
commit | dc104f4bb2d0a652dee010e47bc89c1ad2ab37c9 (patch) | |
tree | b01ef7d6f5e41c03da1f0056c532df78f224f11a /drivers/scsi/aic7xxx | |
parent | b7421afcec0c77ab58633587ddc29d53e6eb95af (diff) | |
download | linux-dc104f4bb2d0a652dee010e47bc89c1ad2ab37c9.tar.xz |
nvdimm/blk: 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.
Since nvdimm/blk uses devm we just need to move the devm
registration towards the end. And in hindsight, that seems
to also provide a fix given del_gendisk() should not be
called unless the disk was already added via add_disk().
The probably of that issue happening is low though, like
OOM while calling devm_add_action(), so the fix is minor.
We manually unwind in case of add_disk() failure prior
to the devm registration.
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Link: https://lore.kernel.org/r/20211103230437.1639990-5-mcgrof@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/scsi/aic7xxx')
0 files changed, 0 insertions, 0 deletions