WSL2-Linux-Kernel/drivers/pcmcia
Yang Yingliang 9d060f2fc4 pcmcia: ds: fix possible name leak in error path in pcmcia_device_add()
[ Upstream commit 99e1241049a92dd3e9a90a0f91e32ce390133278 ]

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:08:27 +01:00
..
Kconfig pcmcia: db1xxx_ss: restrict to MIPS_DB1XXX boards 2022-06-14 18:36:02 +02:00
Makefile pcmcia: Remove NEC VRC4173 CARDU 2020-12-05 09:53:59 +01:00
at91_cf.c pcmcia: at91_cf: remove platform data support 2020-11-27 22:25:15 +01:00
bcm63xx_pcmcia.c
bcm63xx_pcmcia.h
cardbus.c pcmcia: include cs_internal.h for missing declarations 2019-11-22 07:03:04 +01:00
cirrus.h
cistpl.c pcmcia: cistpl: Demote non-conformant kernel-doc headers to standard comments 2021-03-15 08:22:22 +01:00
cs.c pcmcia: cs: fix possible hung task and memory leak pccardd() 2023-11-20 11:08:27 +01:00
cs_internal.h pcmcia: make pccard_loop_tuple() static 2020-05-18 11:16:39 +02:00
db1xxx_ss.c pcmcia: db1xxx_ss: remove unneeded semicolon 2020-12-05 09:32:17 +01:00
ds.c pcmcia: ds: fix possible name leak in error path in pcmcia_device_add() 2023-11-20 11:08:27 +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: i82092: fix a null pointer dereference bug 2021-07-23 08:08:54 +02:00
i82092aa.h PCMCIA/i82092: delete enter/leave macro 2019-12-16 11:49:54 +01:00
i82365.c
i82365.h
max1600.c
max1600.h
o2micro.h
omap_cf.c pcmcia: omap: Fix error return code in omap_cf_probe() 2020-12-05 09:59:13 +01:00
pcmcia_cis.c pcmcia: pcmcia_cis: Demote non-conforming kernel-doc headers to standard kernel-doc 2021-03-15 08:22:23 +01:00
pcmcia_resource.c pcmcia: pcmcia_resource: Fix some kernel-doc formatting/disparities and demote others 2021-03-15 08:22:23 +01:00
pd6729.c
pd6729.h
pxa2xx_balloon3.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
pxa2xx_base.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 256 2019-06-05 17:30:27 +02:00
pxa2xx_base.h
pxa2xx_cm_x2xx.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
pxa2xx_cm_x255.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
pxa2xx_cm_x270.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
pxa2xx_colibri.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
pxa2xx_e740.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
pxa2xx_hx4700.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
pxa2xx_mainstone.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
pxa2xx_palmld.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
pxa2xx_palmtc.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
pxa2xx_palmtx.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
pxa2xx_sharpsl.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
pxa2xx_stargate2.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
pxa2xx_trizeps4.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
pxa2xx_viper.c
pxa2xx_vpac270.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
ricoh.h
rsrc_iodyn.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
rsrc_mgr.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
rsrc_nonstatic.c pcmcia: rsrc_nonstatic: Fix memory leak in nonstatic_release_resource_db() 2023-08-26 14:23:24 +02:00
sa11xx_base.c
sa11xx_base.h
sa1100_generic.c
sa1100_generic.h
sa1100_h3600.c
sa1100_simpad.c pcmcia: remove some unused space characters 2020-03-31 18:48:22 +02:00
sa1111_badge4.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
sa1111_generic.c ARM: 9048/1: sa1111: make sa1111 bus's remove callback return void 2021-02-01 19:42:13 +00:00
sa1111_generic.h
sa1111_jornada720.c
sa1111_lubbock.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
sa1111_neponset.c
soc_common.c
soc_common.h pcmcia: soc_common.h: Replace zero-length array with flexible-array member 2020-03-28 07:52:13 +01:00
socket_sysfs.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
tcic.c
tcic.h
ti113x.h
topic.h
vg468.h
vrc4171_card.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
xxs1500_ss.c
yenta_socket.c pcmcia: Use CardBus window names (PCI_CB_BRIDGE_IO_0_WINDOW etc) when freeing 2020-05-21 15:53:07 -05:00
yenta_socket.h