android_kernel_motorola_sm6225/drivers/pcmcia
Yang Yingliang ac6d92fbec 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 10:29:20 +01:00
..
at91_cf.c pcmcia: at91_cf: Use PTR_ERR_OR_ZERO() 2017-11-29 21:58:58 +01:00
bcm63xx_pcmcia.c drivers/pcmcia: Convert timers to use timer_setup() 2017-11-04 12:03:13 +01:00
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
cardbus.c PCI: Add for_each_pci_bridge() helper 2017-11-06 18:48:58 -06:00
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 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:29:20 +01:00
electra_cf.c pcmcia/electra_cf: Convert timers to use timer_setup() 2017-10-18 12:39:37 +01:00
i82092.c pcmcia: i82092: fix a null pointer dereference bug 2021-08-12 13:19:43 +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 drivers/pcmcia: Convert timers to use timer_setup() 2017-11-04 12:03:13 +01:00
i82365.h
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
o2micro.h
omap_cf.c drivers/pcmcia: omap1: Fix error in automated timer conversion 2017-11-06 12:49:15 -08:00
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 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
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 pcmcia: sa1111: remove special sa1111 mmio accessors 2017-10-03 13:24:11 +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
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: soc_common: Handle return value of clk_prepare_enable 2018-01-24 19:24:39 +01: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 drivers/pcmcia: Convert timers to use timer_setup() 2017-11-04 12:03:13 +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:08:17 -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