Commit 47d34aa2 authored by Luis Chamberlain's avatar Luis Chamberlain Committed by Jens Axboe

floppy: 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: default avatarLuis Chamberlain <mcgrof@kernel.org>
Link: https://lore.kernel.org/r/20210927220302.1073499-6-mcgrof@kernel.orgSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 662167e5
...@@ -4697,8 +4697,10 @@ static int __init do_floppy_init(void) ...@@ -4697,8 +4697,10 @@ static int __init do_floppy_init(void)
registered[drive] = true; registered[drive] = true;
device_add_disk(&floppy_device[drive].dev, disks[drive][0], err = device_add_disk(&floppy_device[drive].dev,
NULL); disks[drive][0], NULL);
if (err)
goto out_remove_drives;
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment