Message ID | 20210904013536.3181237-6-mcgrof@kernel.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | block: 6th batch of add_disk() error handling conversions | expand |
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index 3592a6277d0b..0434f28742e7 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -4696,8 +4696,10 @@ static int __init do_floppy_init(void) registered[drive] = true; - device_add_disk(&floppy_device[drive].dev, disks[drive][0], - NULL); + err = device_add_disk(&floppy_device[drive].dev, + disks[drive][0], NULL); + if (err) + goto out_remove_drives; } return 0;
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> --- drivers/block/floppy.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)