Re: [PATCH v2] floppy: fix reference leak on platform_device_register() failure

Jens Axboe
2026-04-17T20:39:28Z

On Wed, 15 Apr 2026 22:57:08 +0800, Guangshuo Li wrote:
> When platform_device_register() fails in do_floppy_init(), the embedded
> struct device in floppy_device[drive] has already been initialized by
> device_initialize(), but the failure path jumps to out_remove_drives
> without dropping the device reference for the current drive.
>
> Previously registered floppy devices are cleaned up in out_remove_drives,
> but the device for the drive that fails registration is not, leading to
> a reference leak.
>
> [...]

Applied, thanks!

[1/1] floppy: fix reference leak on platform_device_register() failure
commit: e784f2ea0b4fd0e7b70028ff8218f22456c5dcf8

Best regards,
--
Jens Axboe