kernel_samsung_a53x/drivers/pcmcia
Yang Yingliang ba5cb6b896 pcmcia: ds: fix possible name leak in error path in pcmcia_device_add()
[ Upstream commit 99e1241049a92dd3e9a90a0f91e32ce390133278 ]

Afer commit 1fa5ae857bb1 ("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: 1fa5ae857bb1 ("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>
2024-11-18 11:43:06 +01:00
..
at91_cf.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bcm63xx_pcmcia.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bcm63xx_pcmcia.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cardbus.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cirrus.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cistpl.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cs.c pcmcia: cs: fix possible hung task and memory leak pccardd() 2024-11-18 11:43:06 +01:00
cs_internal.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
db1xxx_ss.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ds.c pcmcia: ds: fix possible name leak in error path in pcmcia_device_add() 2024-11-18 11:43:06 +01:00
electra_cf.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i82092.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i82092aa.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i82365.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i82365.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
max1600.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
max1600.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
o2micro.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
omap_cf.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pcmcia_cis.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pcmcia_resource.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pd6729.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pd6729.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pxa2xx_balloon3.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pxa2xx_base.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pxa2xx_base.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pxa2xx_cm_x2xx.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pxa2xx_cm_x255.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pxa2xx_cm_x270.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pxa2xx_colibri.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pxa2xx_e740.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pxa2xx_hx4700.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pxa2xx_mainstone.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pxa2xx_palmld.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pxa2xx_palmtc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pxa2xx_palmtx.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pxa2xx_sharpsl.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pxa2xx_stargate2.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pxa2xx_trizeps4.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pxa2xx_viper.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pxa2xx_vpac270.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ricoh.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rsrc_iodyn.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rsrc_mgr.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rsrc_nonstatic.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sa11xx_base.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sa11xx_base.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sa1100_generic.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sa1100_generic.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sa1100_h3600.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sa1100_simpad.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sa1111_badge4.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sa1111_generic.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sa1111_generic.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sa1111_jornada720.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sa1111_lubbock.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sa1111_neponset.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
soc_common.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
soc_common.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
socket_sysfs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tcic.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tcic.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ti113x.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
topic.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vg468.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vrc4171_card.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vrc4173_cardu.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vrc4173_cardu.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xxs1500_ss.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
yenta_socket.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
yenta_socket.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00