linux-stable/drivers/pcmcia
Yang Yingliang 2527dddb4e 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:27:35 +01:00
..
Kconfig pcmcia: db1xxx_ss: restrict to MIPS_DB1XXX boards 2022-06-14 16:53:55 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
at91_cf.c
bcm63xx_pcmcia.c
bcm63xx_pcmcia.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
bfin_cf_pcmcia.c
cardbus.c
cirrus.h
cistpl.c
cs.c pcmcia: cs: fix possible hung task and memory leak pccardd() 2023-11-20 10:27:35 +01:00
cs_internal.h PCMCIA / PM: Avoid noirq suspend aborts during suspend-to-idle 2018-05-30 07:52:39 +02:00
db1xxx_ss.c MIPS: Alchemy: Threaded carddetect irqs for devboards 2017-08-29 15:21:53 +02:00
ds.c pcmcia: ds: fix possible name leak in error path in pcmcia_device_add() 2023-11-20 10:27:35 +01:00
electra_cf.c drivers/pcmcia: NO_IRQ removal for electra_cf.c 2017-03-21 22:09:28 +11:00
i82092.c pcmcia: i82092: fix a null pointer dereference bug 2021-08-15 13:03:32 +02:00
i82092aa.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
i82365.c Annotate hardware config module parameters in drivers/pcmcia/ 2017-04-20 12:02:32 +01:00
i82365.h
m32r_cfc.c
m32r_cfc.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
m32r_pcc.c drivers/pcmcia/m32r_pcc.c: check return from add_pcc_socket 2016-12-12 18:55:06 -08:00
m32r_pcc.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
o2micro.h
omap_cf.c
pcmcia_cis.c
pcmcia_resource.c
pd6729.c
pd6729.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pxa2xx_balloon3.c
pxa2xx_base.c pcmcia: lubbock: fix sockets configuration 2016-09-12 10:57:01 +01:00
pxa2xx_base.h pcmcia: lubbock: fix sockets configuration 2016-09-12 10:57:01 +01:00
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:14:46 -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:35:11 +02:00
sa11xx_base.c pcmcia: sa11xx_base: add units to the timing information 2016-09-12 10:57:01 +01:00
sa11xx_base.h
sa1100_assabet.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sa1100_cerf.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sa1100_generic.c
sa1100_generic.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sa1100_h3600.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sa1100_nanoengine.c
sa1100_shannon.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sa1100_simpad.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sa1111_badge4.c pcmcia: sa1111: fix propagation of lowlevel board init return code 2016-09-12 10:57:01 +01:00
sa1111_generic.c pcmcia: sa1111: fix propagation of lowlevel board init return code 2016-09-12 10:57:01 +01:00
sa1111_generic.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sa1111_jornada720.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sa1111_lubbock.c pcmcia: lubbock: fix sockets configuration 2016-09-12 10:57:01 +01:00
sa1111_neponset.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
soc_common.c pcmcia: fix return value of soc_pcmcia_regulator_set 2016-11-11 08:45:08 -08:00
soc_common.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
socket_sysfs.c
tcic.c Annotate hardware config module parameters in drivers/pcmcia/ 2017-04-20 12:02:32 +01:00
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:14:46 -08:00
yenta_socket.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00