Skip to content

floppy: fix reference leak on platform_device_register() failure#737

Open
blktests-ci[bot] wants to merge 1 commit intolinus-master_basefrom
series/1080785=>linus-master
Open

floppy: fix reference leak on platform_device_register() failure#737
blktests-ci[bot] wants to merge 1 commit intolinus-master_basefrom
series/1080785=>linus-master

Conversation

@blktests-ci
Copy link
Copy Markdown

@blktests-ci blktests-ci Bot commented Apr 13, 2026

Pull request for series with
subject: floppy: fix reference leak on platform_device_register() failure
version: 1
url: https://patchwork.kernel.org/project/linux-block/list/?series=1080785

@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Apr 13, 2026

Upstream branch: 028ef9c
series: https://patchwork.kernel.org/project/linux-block/list/?series=1080785
version: 1

@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Apr 14, 2026

Upstream branch: d60bc14
series: https://patchwork.kernel.org/project/linux-block/list/?series=1080785
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1080785=>linus-master branch from 86fdf86 to adccf02 Compare April 14, 2026 06:49
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Apr 15, 2026

Upstream branch: d60bc14
series: https://patchwork.kernel.org/project/linux-block/list/?series=1081622
version: 2

@blktests-ci blktests-ci Bot added V2 and removed V1 labels Apr 15, 2026
@blktests-ci blktests-ci Bot force-pushed the series/1080785=>linus-master branch from adccf02 to 2749b75 Compare April 15, 2026 15:00
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from 6b4d829 to ceec5ed Compare April 21, 2026 06:51
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Apr 21, 2026

Upstream branch: b4e0758
series: https://patchwork.kernel.org/project/linux-block/list/?series=1081622
version: 2

@blktests-ci blktests-ci Bot force-pushed the series/1080785=>linus-master branch from 2749b75 to 49ab35a Compare April 21, 2026 06:53
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from ceec5ed to 3b54e52 Compare April 22, 2026 20:20
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Apr 22, 2026

Upstream branch: 6596a02
series: https://patchwork.kernel.org/project/linux-block/list/?series=1081622
version: 2

@blktests-ci blktests-ci Bot force-pushed the series/1080785=>linus-master branch from 49ab35a to ffd5465 Compare April 22, 2026 20:21
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from 3b54e52 to 6a0b974 Compare April 23, 2026 16:58
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Apr 23, 2026

Upstream branch: 507bd4b
series: https://patchwork.kernel.org/project/linux-block/list/?series=1081622
version: 2

@blktests-ci blktests-ci Bot force-pushed the series/1080785=>linus-master branch from ffd5465 to 136b0ca Compare April 23, 2026 17:06
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from 6a0b974 to 59ca59b Compare April 24, 2026 00:56
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Apr 24, 2026

Upstream branch: dd6c438
series: https://patchwork.kernel.org/project/linux-block/list/?series=1081622
version: 2

@blktests-ci blktests-ci Bot force-pushed the series/1080785=>linus-master branch from 136b0ca to 7464bb4 Compare April 24, 2026 01:03
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch 2 times, most recently from 94f0438 to 857ada9 Compare April 24, 2026 07:54
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Apr 24, 2026

Upstream branch: dd6c438
series: https://patchwork.kernel.org/project/linux-block/list/?series=1081622
version: 2

@blktests-ci blktests-ci Bot force-pushed the series/1080785=>linus-master branch from 7464bb4 to d4c2ad1 Compare April 24, 2026 07:58
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from 857ada9 to 482ce5b Compare April 29, 2026 02:21
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Apr 29, 2026

Upstream branch: dca922e
series: https://patchwork.kernel.org/project/linux-block/list/?series=1081622
version: 2

@blktests-ci blktests-ci Bot force-pushed the series/1080785=>linus-master branch from d4c2ad1 to cfc1509 Compare April 29, 2026 02:39
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from 482ce5b to 5a9f7c7 Compare April 30, 2026 07:29
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Apr 30, 2026

Upstream branch: e75a43c
series: https://patchwork.kernel.org/project/linux-block/list/?series=1081622
version: 2

@blktests-ci blktests-ci Bot force-pushed the series/1080785=>linus-master branch from cfc1509 to 2fb4bdd Compare April 30, 2026 07:40
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from 5a9f7c7 to 25a041f Compare May 3, 2026 02:07
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented May 3, 2026

Upstream branch: 66edb90
series: https://patchwork.kernel.org/project/linux-block/list/?series=1081622
version: 2

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.

The issue was identified by a static analysis tool I developed and
confirmed by manual review. Fix this by calling put_device() for the
current floppy device before jumping to the common cleanup path.

Fixes: 94fd0db ("[PATCH] Floppy: Add cmos attribute to floppy driver")
Cc: [email protected]
Signed-off-by: Guangshuo Li <[email protected]>
@blktests-ci blktests-ci Bot force-pushed the series/1080785=>linus-master branch from 2fb4bdd to 9a6efd6 Compare May 3, 2026 02:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant