diff options
author | Luis Chamberlain <mcgrof@kernel.org> | 2021-09-27 15:03:02 -0700 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-10-18 14:41:37 -0600 |
commit | 2f1510708970c873c5eee190b77071f59f67cef8 (patch) | |
tree | 1d96af2bd5696425b8051ff77907d56e72fd5212 /drivers | |
parent | deae1138d04758c7f8939fcb8aee330bc37e3015 (diff) | |
download | linux-2f1510708970c873c5eee190b77071f59f67cef8.tar.bz2 |
block/ataflop: 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.
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Link: https://lore.kernel.org/r/20210927220302.1073499-15-mcgrof@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/block/ataflop.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/block/ataflop.c b/drivers/block/ataflop.c index a07cb9b79a6c..9bc5cce6b29a 100644 --- a/drivers/block/ataflop.c +++ b/drivers/block/ataflop.c @@ -2082,7 +2082,9 @@ static int __init atari_floppy_init (void) for (i = 0; i < FD_MAX_UNITS; i++) { unit[i].track = -1; unit[i].flags = 0; - add_disk(unit[i].disk[0]); + ret = add_disk(unit[i].disk[0]); + if (ret) + goto err_out_dma; unit[i].registered[0] = true; } @@ -2093,6 +2095,8 @@ static int __init atari_floppy_init (void) return 0; +err_out_dma: + atari_stram_free(DMABuffer); err: while (--i >= 0) atari_cleanup_floppy_disk(&unit[i]); |