linux-stable/drivers/pcmcia
Yang Yingliang f258fd94ab pcmcia: ds: fix possible name leak in error path in pcmcia_device_add()
[ Upstream commit 99e1241049 ]

Afer commit 1fa5ae857b ("driver core: get rid of struct device's
bus_id string array"), the name of device is allocated dynamically.
Therefore, it needs to be freed, which is done by the driver core for
us once all references to the device are gone. Therefore, move the
dev_set_name() call immediately before the call device_register(), which
either succeeds (then the freeing will be done upon subsequent remvoal),
or puts the reference in the error call. Also, it is not unusual that the
return value of dev_set_name is not checked.

Fixes: 1fa5ae857b ("driver core: get rid of struct device's bus_id string array")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
[linux@dominikbrodowski.net: simplification, commit message modified]
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-11-20 11:52:13 +01:00
..
bcm63xx_pcmcia.c pcmcia: Use platform_get_irq() to get the interrupt 2022-05-28 09:25:31 +02:00
bcm63xx_pcmcia.h
cardbus.c
cirrus.h
cistpl.c pcmcia: cistpl: Demote non-conformant kernel-doc headers to standard comments 2021-03-15 08:22:22 +01:00
cs_internal.h
cs.c pcmcia: cs: fix possible hung task and memory leak pccardd() 2023-11-20 11:52:13 +01:00
db1xxx_ss.c pcmcia: db1xxx_ss: Fix fall-through warning for Clang 2021-10-13 14:47:48 -05:00
ds.c pcmcia: ds: fix possible name leak in error path in pcmcia_device_add() 2023-11-20 11:52:13 +01:00
electra_cf.c pcmcia/electra_cf: Fix some return values in 'electra_cf_probe()' in case of error 2020-12-05 09:31:37 +01:00
i82092.c pcmcia: Add __init/__exit annotations to module init/exit funcs 2022-09-22 16:45:25 +02:00
i82092aa.h
i82365.c
i82365.h
Kconfig pcmcia: remove AT91RM9200 Compact Flash driver 2022-09-27 08:12:16 +02:00
Makefile pcmcia: remove AT91RM9200 Compact Flash driver 2022-09-27 08:12:16 +02:00
max1600.c
max1600.h
o2micro.h
omap_cf.c pcmcia: Removed unused variable control. 2022-09-24 16:05:54 +02:00
pcmcia_cis.c pcmcia: hide the MAC address helpers if !NET 2021-11-22 14:02:52 +00:00
pcmcia_resource.c pcmcia: make pcmcia_release_io() void, as no-one is interested in return value 2022-01-02 19:01:37 +01:00
pd6729.c
pd6729.h
pxa2xx_base.c ARM: pxa: pcmcia: move smemc configuration back to arch 2022-05-07 22:55:49 +02:00
pxa2xx_base.h
pxa2xx_mainstone.c
pxa2xx_sharpsl.c ARM: pxa: move pcmcia board data into mach-pxa 2022-04-19 21:34:05 +02:00
ricoh.h
rsrc_iodyn.c
rsrc_mgr.c
rsrc_nonstatic.c pcmcia: rsrc_nonstatic: Fix memory leak in nonstatic_release_resource_db() 2023-08-23 17:52:24 +02:00
sa11xx_base.c
sa11xx_base.h
sa1100_generic.c pcmcia: sa1100: Make sa11x0_drv_pcmcia_legacy_remove() return void 2022-09-22 16:23:51 +02:00
sa1100_generic.h
sa1100_h3600.c
sa1100_simpad.c
sa1111_badge4.c
sa1111_generic.c ARM: pxa: split up mach/hardware.h 2022-04-19 16:27:05 +02:00
sa1111_generic.h
sa1111_jornada720.c
sa1111_lubbock.c ARM: pxa: split up mach/hardware.h 2022-04-19 16:27:05 +02:00
sa1111_neponset.c
soc_common.c ARM: pxa/sa1100: move I/O space to PCI_IOBASE 2022-05-07 22:56:17 +02:00
soc_common.h ARM: pxa: move pcmcia board data into mach-pxa 2022-04-19 21:34:05 +02:00
socket_sysfs.c pcmcia: use sysfs_emit{,_at} for sysfs output 2022-01-06 09:15:52 +01:00
tcic.c
tcic.h
ti113x.h
topic.h
vg468.h
xxs1500_ss.c
yenta_socket.c drivers/pcmcia: Fix ifdef covering yenta_pm_ops 2022-01-11 14:45:19 -08:00
yenta_socket.h