android_kernel_xiaomi_sm8350/drivers/pcmcia
Yang Yingliang 0bc0e36fcc 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:30:14 +01:00
..
at91_cf.c
bcm63xx_pcmcia.c drivers/pcmcia: Convert timers to use timer_setup() 2017-11-02 15:50:50 -07:00
bcm63xx_pcmcia.h
cardbus.c
cirrus.h
cistpl.c
cs_internal.h
cs.c pcmcia: cs: fix possible hung task and memory leak pccardd() 2023-11-20 10:30:14 +01:00
db1xxx_ss.c
ds.c pcmcia: ds: fix possible name leak in error path in pcmcia_device_add() 2023-11-20 10:30:14 +01:00
electra_cf.c Merge remote-tracking branch 'remotes/origin/tmp-f686d9f' into msm-lahaina 2019-07-01 17:41:24 -07:00
i82092.c pcmcia: i82092: fix a null pointer dereference bug 2021-08-12 13:21:03 +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-02 15:50:50 -07:00
i82365.h
Kconfig
Makefile
max1600.c pcmcia: add MAX1600 library 2018-12-04 22:37:38 +00:00
max1600.h
o2micro.h
omap_cf.c
pcmcia_cis.c Merge remote-tracking branch 'remotes/origin/tmp-f686d9f' into msm-lahaina 2019-07-01 17:41:24 -07:00
pcmcia_resource.c Merge remote-tracking branch 'remotes/origin/tmp-f686d9f' into msm-lahaina 2019-07-01 17:41:24 -07:00
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 Merge remote-tracking branch 'remotes/origin/tmp-f686d9f' into msm-lahaina 2019-07-01 17:41:24 -07:00
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 Merge remote-tracking branch 'remotes/origin/tmp-f686d9f' into msm-lahaina 2019-07-01 17:41:24 -07:00
pxa2xx_palmtc.c Merge remote-tracking branch 'remotes/origin/tmp-f686d9f' into msm-lahaina 2019-07-01 17:41:24 -07:00
pxa2xx_palmtx.c
pxa2xx_sharpsl.c
pxa2xx_stargate2.c Merge remote-tracking branch 'remotes/origin/tmp-f686d9f' into msm-lahaina 2019-07-01 17:41:24 -07:00
pxa2xx_trizeps4.c
pxa2xx_viper.c
pxa2xx_vpac270.c
ricoh.h pcmcia: Implement CLKRUN protocol disabling for Ricoh bridges 2018-10-01 12:17:03 +02:00
rsrc_iodyn.c Merge remote-tracking branch 'remotes/origin/tmp-f686d9f' into msm-lahaina 2019-07-01 17:41:24 -07:00
rsrc_mgr.c Merge remote-tracking branch 'remotes/origin/tmp-f686d9f' into msm-lahaina 2019-07-01 17:41:24 -07:00
rsrc_nonstatic.c
sa11xx_base.c pcmcia: sa11xx_base: add units to the timing information 2016-09-12 10:57:01 +01:00
sa11xx_base.h PCMCIA: sa1111: wrap soc_pcmcia_socket to contain sa1111 specific data 2009-11-09 08:30:11 +01:00
sa1100_generic.c
sa1100_generic.h
sa1100_h3600.c
sa1100_simpad.c pcmcia: sa1100*: remove redundant bvd1/bvd2 setting 2018-12-04 22:37:38 +00:00
sa1111_badge4.c Merge remote-tracking branch 'remotes/origin/tmp-f686d9f' into msm-lahaina 2019-07-01 17:41:24 -07:00
sa1111_generic.c
sa1111_generic.h
sa1111_jornada720.c ARM: sa1100/jornada720: switch PCMCIA to gpiod APIs 2018-12-04 22:37:38 +00:00
sa1111_lubbock.c Merge remote-tracking branch 'remotes/origin/tmp-f686d9f' into msm-lahaina 2019-07-01 17:41:24 -07:00
sa1111_neponset.c
soc_common.c gpiolib: Pass array info to get/set array functions 2018-09-13 11:16:54 +02:00
soc_common.h
socket_sysfs.c Merge remote-tracking branch 'remotes/origin/tmp-f686d9f' into msm-lahaina 2019-07-01 17:41:24 -07:00
tcic.c drivers/pcmcia: Convert timers to use timer_setup() 2017-11-02 15:50:50 -07:00
tcic.h
ti113x.h pcmcia: Convert dev_printk to dev_<level> 2015-05-30 16:09:04 +02:00
topic.h Disable write buffering on Toshiba ToPIC95 2015-06-13 23:40:21 +02:00
vg468.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
vrc4171_card.c
vrc4173_cardu.c
vrc4173_cardu.h Update Yoichi Yuasa's e-mail address 2009-07-03 15:45:29 +01:00
xxs1500_ss.c
yenta_socket.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02: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