mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
Revert "floppy: fix reference leak on platform_device_register() failure"
This reverts commit e784f2ea0b.
Jiri says the patch is buggy, and it looks like he is right revert it
for now.
Link: https://lore.kernel.org/linux-block/897f442d-4e04-4b70-b716-38fd10b8af36@kernel.org/
Reported-by: Jiri Slaby <jirislaby@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
309e02dccf
commit
895a9b3791
|
|
@ -4722,19 +4722,15 @@ static int __init do_floppy_init(void)
|
||||||
floppy_device[drive].dev.groups = floppy_dev_groups;
|
floppy_device[drive].dev.groups = floppy_dev_groups;
|
||||||
|
|
||||||
err = platform_device_register(&floppy_device[drive]);
|
err = platform_device_register(&floppy_device[drive]);
|
||||||
if (err) {
|
if (err)
|
||||||
platform_device_put(&floppy_device[drive]);
|
|
||||||
goto out_remove_drives;
|
goto out_remove_drives;
|
||||||
}
|
|
||||||
registered[drive] = true;
|
registered[drive] = true;
|
||||||
|
|
||||||
err = device_add_disk(&floppy_device[drive].dev,
|
err = device_add_disk(&floppy_device[drive].dev,
|
||||||
disks[drive][0], NULL);
|
disks[drive][0], NULL);
|
||||||
if (err) {
|
if (err)
|
||||||
platform_device_unregister(&floppy_device[drive]);
|
|
||||||
registered[drive] = false;
|
|
||||||
goto out_remove_drives;
|
goto out_remove_drives;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user