linux/drivers
Guangshuo Li e784f2ea0b floppy: fix reference leak on platform_device_register() failure
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: 94fd0db7bf ("[PATCH] Floppy: Add cmos attribute to floppy driver")
Cc: stable@vger.kernel.org
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
Link: https://patch.msgid.link/20260415145708.3331818-1-lgs201920130244@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2026-04-17 14:36:40 -06:00
..
accel drm for v7.1-rc1 2026-04-15 08:45:00 -07:00
accessibility Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
acpi arm64 updates for 7.1: 2026-04-14 16:48:56 -07:00
amba Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
android Rust changes for v7.1 2026-04-13 09:54:20 -07:00
ata ata: ahci: force 32-bit DMA for JMicron JMB582/JMB585 2026-04-07 09:36:46 +02:00
atm Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
auxdisplay auxdisplay: line-display: fix NULL dereference in linedisp_release 2026-03-27 09:54:31 +01:00
base drm for v7.1-rc1 2026-04-15 08:45:00 -07:00
bcma Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
block floppy: fix reference leak on platform_device_register() failure 2026-04-17 14:36:40 -06:00
bluetooth Bluetooth: hci_qca: Fix missing wakeup during SSR memdump handling 2026-04-13 09:19:42 -04:00
bus bus: fsl-mc: use generic driver_override infrastructure 2026-04-04 20:41:25 +02:00
cache cache: ax45mp: Fix device node reference leak in ax45mp_cache_init() 2026-02-06 19:54:40 +00:00
cdrom Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
cdx Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
char random: vDSO: Remove ifdeffery 2026-03-11 15:22:49 +01:00
clk Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-03-26 12:09:57 -07:00
clocksource clocksource: Rewrite watchdog code completely 2026-03-20 13:36:32 +01:00
comedi comedi: dt2815: add hardware detection to prevent crash 2026-04-02 14:40:27 +02:00
connector Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
counter counter: rz-mtu3-cnt: do not use struct rz_mtu3_channel's dev member 2026-03-22 15:59:22 +09:00
cpufreq Power management updates for 7.1-rc1 2026-04-13 19:47:52 -07:00
cpuidle powerpc updates for 7.1 2026-04-14 17:10:15 -07:00
crypto - Change the SEV host code handling of when SNP gets enabled in order to allow 2026-04-14 15:20:54 -07:00
cxl cxl: Adjust the startup priority of cxl_pmem to be higher than that of cxl_acpi 2026-03-19 15:12:40 -07:00
dax Convert 'alloc_flex' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dca treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
devfreq PM / devfreq: tegra30-devfreq: add support for Tegra114 2026-04-04 03:15:39 +09:00
dibs dibs: change dibs_class to a const struct 2026-03-04 18:48:15 -08:00
dio Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dma dmaengine: xilinx_dma: Fix reset related timeout with two-channel AXIDMA 2026-03-17 16:33:32 +05:30
dma-buf drm for v7.1-rc1 2026-04-15 08:45:00 -07:00
dpll dpll: zl3073x: add ref-sync pair support 2026-04-12 08:27:34 -07:00
edac - Add new AMD MCA bank names and types to the MCA code, preceded by a clean 2026-04-14 15:32:39 -07:00
eisa Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
extcon Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
firewire bonding: prevent potential infinite loop in bond_header_parse() 2026-03-16 19:29:45 -07:00
firmware workqueue: Changes for v7.1 2026-04-15 10:32:08 -07:00
fpga Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
fsi Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
fwctl Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
gnss Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
gpib gpib: fix use-after-free in IO ioctl handlers 2026-04-02 14:30:40 +02:00
gpio [GIT PULL for v7.1] media updates 2026-04-15 08:32:10 -07:00
gpu drm for v7.1-rc1 2026-04-15 08:45:00 -07:00
greybus Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
hid [GIT PULL for v7.1] media updates 2026-04-15 08:32:10 -07:00
hsi Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hte Convert 'alloc_flex' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hv Update for the core interrupt subsystem: 2026-04-14 10:02:41 -07:00
hwmon hwmon: (asus-ec-sensors) Fix T_Sensor for PRIME X670E-PRO WIFI 2026-04-01 07:45:57 -07:00
hwspinlock soc: driver updates for 7.0 2026-02-10 20:45:30 -08:00
hwtracing coresight: don't use bitmap_print_to_pagebuf() 2026-04-09 13:28:05 -04:00
i2c Driver core changes for 7.1-rc1 2026-04-13 19:03:11 -07:00
i3c i3c: dw-i3c-master: Set SIR_REJECT in DAT on device attach and reattach 2026-03-11 22:50:29 +01:00
idle intel_idle: Add Panther Lake C-states table 2026-03-11 12:52:00 +01:00
iio IIO: 3rd set of fixes for the 7.0 cycle. 2026-03-29 15:27:12 +02:00
infiniband drm for v7.1-rc1 2026-04-15 08:45:00 -07:00
input Input updates for v7.0-rc7 2026-04-11 11:12:38 -07:00
interconnect interconnect: qcom: sm8450: Fix NULL pointer dereference in icc_link_nodes() 2026-03-14 12:53:13 +02:00
iommu drm for v7.1-rc1 2026-04-15 08:45:00 -07:00
ipack Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
irqchip A small update for the MSI interrupt library to check for callers which 2026-04-14 10:23:19 -07:00
isdn Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
leds Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
macintosh Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
mailbox treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
mcb Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
md md/raid5: fix soft lockup in retry_aligned_read() 2026-04-07 15:13:52 +08:00
media [GIT PULL for v7.1] media updates 2026-04-15 08:32:10 -07:00
memory Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
memstick Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
message Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
mfd mfd: cs42l43: Add support for the B variant 2026-03-09 10:29:32 +00:00
misc hardening updates for v7.1-rc1 2026-04-13 17:52:29 -07:00
mmc mmc: vub300: fix use-after-free on disconnect 2026-03-31 13:11:20 +02:00
most Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
mtd mtd: rawnand: pl353: make sure optimal timings are applied 2026-03-18 18:08:25 +01:00
mux Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
net Networking changes for 7.1. 2026-04-14 18:36:10 -07:00
nfc gpio updates for v7.1-rc1 2026-04-13 20:10:58 -07:00
ntb Merge branch 'nocache-cleanup' 2026-04-13 08:39:51 -07:00
nubus Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
nvdimm vfs-7.1-rc1.integrity 2026-04-13 10:40:26 -07:00
nvme for-7.1/io_uring-20260411 2026-04-13 16:22:30 -07:00
nvmem nvmem: zynqmp_nvmem: Fix buffer size in DMA and memcpy 2026-04-02 16:44:40 +02:00
of device property: Make modifications of fwnode "flags" thread safe 2026-03-26 22:00:59 +01:00
opp OPP: Move break out of scoped_guard in dev_pm_opp_xlate_required_opp() 2026-02-23 11:05:59 +05:30
parisc Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
parport Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
pci ACPI support updates for 7.1-rc1 2026-04-13 19:25:07 -07:00
pcmcia Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
peci Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
perf arm64 updates for 7.1: 2026-04-14 16:48:56 -07:00
phy Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-04-02 11:03:13 -07:00
pinctrl gpio updates for v7.1-rc1 2026-04-13 20:10:58 -07:00
platform [GIT PULL for v7.1] media updates 2026-04-15 08:32:10 -07:00
pmdomain pmdomain: imx8mp-blk-ctrl: Keep the NOC_HDCP clock enabled 2026-04-01 13:03:07 +02:00
pnp Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
power power sequencing updates for v7.1-rc1 2026-04-13 20:28:22 -07:00
powercap powercap: intel_rapl: Consolidate PL4 and PMU support flags into rapl_defaults 2026-04-01 16:03:05 +02:00
pps Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ps3 Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ptp ptp: vmw: Convert to a platform driver 2026-03-17 19:06:19 -07:00
pwm pwm: th1520: remove impl Send/Sync for Th1520PwmDriverData 2026-04-03 11:57:35 +02:00
rapidio Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ras Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
regulator gpio updates for v7.1-rc1 2026-04-13 20:10:58 -07:00
remoteproc remoteproc: imx_rproc: Fix unreachable platform prepare_ops 2026-03-05 10:18:23 -07:00
resctrl arm64 updates for 7.1: 2026-04-14 16:48:56 -07:00
reset reset: spacemit: k3: Decouple composite reset lines 2026-03-23 12:25:47 +01:00
rpmsg Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
rtc rtc: cmos: Do not require IRQ if ACPI alarm is used 2026-04-04 19:14:58 +02:00
s390 Driver core changes for 7.1-rc1 2026-04-13 19:03:11 -07:00
sbus Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
scsi Networking changes for 7.1. 2026-04-14 18:36:10 -07:00
sh Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
siox Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
slimbus driver core: platform: use generic driver_override infrastructure 2026-03-17 20:30:57 +01:00
soc Driver core changes for 7.1-rc1 2026-04-13 19:03:11 -07:00
soundwire soundwire: debugfs: initialize firmware_file to empty string 2026-04-02 16:15:23 +02:00
spi Driver core changes for 7.1-rc1 2026-04-13 19:03:11 -07:00
spmi Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ssb Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
staging [GIT PULL for v7.1] media updates 2026-04-15 08:32:10 -07:00
target for-7.1/block-20260411 2026-04-13 15:51:31 -07:00
tc Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
tee tee: shm: Remove refcounting of kernel pages 2026-03-03 09:03:04 +01:00
thermal bitmap updates for v7.1 2026-04-14 08:55:18 -07:00
thunderbolt thunderbolt: Fix property read in nhi_wake_supported() 2026-03-09 12:36:54 +01:00
tty fbdev fixes & cleanups for 7.1-rc1: 2026-04-15 08:37:45 -07:00
ufs scsi: ufs: core: Fix SError in ufshcd_rtc_work() during UFS suspend 2026-03-07 11:08:39 -05:00
uio Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
usb usb: typec: ucsi: skip connector validation before init 2026-04-07 13:35:44 +02:00
vdpa vdpa: use generic driver_override infrastructure 2026-04-04 00:47:50 +02:00
vfio drm for v7.1-rc1 2026-04-15 08:45:00 -07:00
vhost vsock: add G2H fallback for CIDs not owned by H2G transport 2026-03-12 10:59:36 +01:00
video drm for v7.1-rc1 2026-04-15 08:45:00 -07:00
virt - Print TDX module version during boot 2026-04-14 14:42:55 -07:00
virtio dma-mapping: Clarify valid conditions for CPU cache line overlap 2026-03-20 11:33:24 +01:00
w1 Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
watchdog watchdog: ni903x_wdt: Convert to a platform driver 2026-04-07 21:06:59 +02:00
xen ACPI support updates for 7.1-rc1 2026-04-13 19:25:07 -07:00
zorro Convert 'alloc_flex' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
Kconfig
Makefile phy: enter drivers/phy/Makefile even without CONFIG_GENERIC_PHY 2026-02-04 20:45:26 +05:30