linux-stable/drivers/pcmcia
Yang Yingliang ac6d92fbec 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 10:29:20 +01:00
..
Kconfig pcmcia: db1xxx_ss: restrict to MIPS_DB1XXX boards 2022-06-14 16:59:31 +02:00
Makefile Merge branch 'for-linus-sa1100' of git://git.armlinux.org.uk/~rmk/linux-arm 2018-04-09 09:26:36 -07:00
at91_cf.c pcmcia: at91_cf: Use PTR_ERR_OR_ZERO() 2017-11-29 21:58:58 +01:00
bcm63xx_pcmcia.c
bcm63xx_pcmcia.h
cardbus.c
cirrus.h
cistpl.c treewide: kmalloc() -> kmalloc_array() 2018-06-12 16:19:22 -07:00
cs.c pcmcia: cs: fix possible hung task and memory leak pccardd() 2023-11-20 10:29:20 +01:00
cs_internal.h PCMCIA / PM: Avoid noirq suspend aborts during suspend-to-idle 2018-02-22 22:51:12 +01:00
db1xxx_ss.c
ds.c pcmcia: ds: fix possible name leak in error path in pcmcia_device_add() 2023-11-20 10:29:20 +01:00
electra_cf.c
i82092.c pcmcia: i82092: fix a null pointer dereference bug 2021-08-12 13:19:43 +02:00
i82092aa.h
i82365.c
i82365.h
o2micro.h
omap_cf.c
pcmcia_cis.c
pcmcia_resource.c pcmcia: remove long deprecated pcmcia_request_exclusive_irq() function 2018-08-18 12:30:42 -07:00
pd6729.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
pd6729.h
pxa2xx_balloon3.c
pxa2xx_base.c
pxa2xx_base.h
pxa2xx_cm_x2xx.c
pxa2xx_cm_x255.c
pxa2xx_cm_x270.c
pxa2xx_colibri.c
pxa2xx_e740.c
pxa2xx_hx4700.c
pxa2xx_mainstone.c
pxa2xx_palmld.c
pxa2xx_palmtc.c
pxa2xx_palmtx.c
pxa2xx_sharpsl.c
pxa2xx_stargate2.c
pxa2xx_trizeps4.c
pxa2xx_viper.c
pxa2xx_vpac270.c
ricoh.h pcmcia: Implement CLKRUN protocol disabling for Ricoh bridges 2018-11-13 11:08:17 -08:00
rsrc_iodyn.c
rsrc_mgr.c
rsrc_nonstatic.c pcmcia: rsrc_nonstatic: Fix memory leak in nonstatic_release_resource_db() 2023-08-30 16:31:43 +02:00
sa11xx_base.c
sa11xx_base.h
sa1100_generic.c ARM: sa1100/shannon: convert to generic CF sockets 2018-04-06 15:53:22 +01:00
sa1100_generic.h ARM: sa1100/shannon: convert to generic CF sockets 2018-04-06 15:53:22 +01:00
sa1100_h3600.c ARM: sa1100/h3xxx: switch h3xxx PCMCIA to use gpiod APIs 2018-03-24 14:17:09 +00:00
sa1100_simpad.c ARM: sa1100/simpad: switch simpad CF to use gpiod APIs 2018-04-06 15:53:22 +01:00
sa1111_badge4.c drivers/pcmcia/sa1111_badge4.c: avoid unused function warning 2017-11-17 16:10:04 -08:00
sa1111_generic.c
sa1111_generic.h
sa1111_jornada720.c
sa1111_lubbock.c
sa1111_neponset.c
soc_common.c pcmcia: soc_common: Handle return value of clk_prepare_enable 2018-01-24 19:24:39 +01:00
soc_common.h
socket_sysfs.c
tcic.c
tcic.h
ti113x.h
topic.h
vg468.h
vrc4171_card.c
vrc4173_cardu.c
vrc4173_cardu.h
xxs1500_ss.c
yenta_socket.c pcmcia: Implement CLKRUN protocol disabling for Ricoh bridges 2018-11-13 11:08:17 -08:00
yenta_socket.h