OpenCloudOS-Kernel/drivers/pcmcia
Yang Yingliang c5773c37fd 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:59:31 +01:00
..
Kconfig pcmcia : make PCMCIA depend on HAS_IOMEM 2023-08-04 15:39:44 +02:00
Makefile pcmcia: remove unused pxa/sa1100 drivers 2023-02-01 17:23:38 +01:00
bcm63xx_pcmcia.c treewide: Convert del_timer*() to timer_shutdown*() 2022-12-25 13:38:09 -08:00
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:59:31 +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: 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:59:31 +01:00
electra_cf.c treewide: Convert del_timer*() to timer_shutdown*() 2022-12-25 13:38:09 -08:00
i82092.c pcmcia: Add __init/__exit annotations to module init/exit funcs 2022-09-22 16:45:25 +02:00
i82092aa.h PCMCIA/i82092: delete enter/leave macro 2019-12-16 11:49:54 +01:00
i82365.c
i82365.h
max1600.c pcmcia: add MAX1600 library 2018-12-04 22:37:38 +00:00
max1600.h pcmcia: add MAX1600 library 2018-12-04 22:37:38 +00:00
o2micro.h
omap_cf.c treewide: Convert del_timer*() to timer_shutdown*() 2022-12-25 13:38:09 -08: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 treewide: Convert del_timer*() to timer_shutdown*() 2022-12-25 13:38:09 -08:00
pd6729.h
pxa2xx_base.c ARM: pxa: remove unused board files 2023-01-20 11:23:44 +01:00
pxa2xx_base.h
pxa2xx_sharpsl.c ARM: pxa: move pcmcia board data into mach-pxa 2022-04-19 21:34:05 +02:00
ricoh.h pcmcia: Implement CLKRUN protocol disabling for Ricoh bridges 2018-10-01 12:17:03 +02:00
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-06-15 13:42:18 +02:00
sa11xx_base.c
sa11xx_base.h
sa1100_generic.c ARM: sa1100: remove unused board files 2023-01-12 10:53:12 +01:00
sa1100_generic.h
sa1100_h3600.c ARM: sa1100: remove unused board files 2023-01-12 10:53:12 +01:00
sa1111_generic.c ARM: pxa: remove unused board files 2023-01-20 11:23:44 +01:00
sa1111_generic.h
sa1111_jornada720.c ARM: sa1100/jornada720: switch PCMCIA to gpiod APIs 2018-12-04 22:37:38 +00:00
sa1111_neponset.c ARM: sa1100/neponset: switch PCMCIA to MAX1600 library and gpiod APIs 2018-12-04 22:37:38 +00:00
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 treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
yenta_socket.c treewide: Convert del_timer*() to timer_shutdown*() 2022-12-25 13:38:09 -08:00
yenta_socket.h