linux/drivers/atm
Xin Xiong 414f10532c atm: fix atm_dev refcnt leaks in atmtcp_remove_persistent
[ Upstream commit 51875dad43 ]

atmtcp_remove_persistent() invokes atm_dev_lookup(), which returns a
reference of atm_dev with increased refcount or NULL if fails.

The refcount leaks issues occur in two error handling paths. If
dev_data->persist is zero or PRIV(dev)->vcc isn't NULL, the function
returns 0 without decreasing the refcount kept by a local variable,
resulting in refcount leaks.

Fix the issue by adding atm_dev_put() before returning 0 both when
dev_data->persist is zero or PRIV(dev)->vcc isn't NULL.

Signed-off-by: Xin Xiong <xiongx18@fudan.edu.cn>
Signed-off-by: Xiyu Yang <xiyuyang19@fudan.edu.cn>
Signed-off-by: Xin Tan <tanxin.ctf@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-08-11 15:33:38 +02:00
..
.gitignore
Kconfig Kconfig: Fix the reference to the IDT77105 Phy driver in the description of ATM_NICSTAR_USE_IDT77105 2019-08-19 18:15:18 -07:00
Makefile
adummy.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
ambassador.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 37 2019-05-24 17:27:11 +02:00
ambassador.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 37 2019-05-24 17:27:11 +02:00
atmtcp.c atm: fix atm_dev refcnt leaks in atmtcp_remove_persistent 2020-08-11 15:33:38 +02:00
eni.c atm: eni: fix uninitialized variable warning 2020-02-01 09:34:46 +00:00
eni.h
firestream.c firestream: fix memory leaks 2020-01-29 16:45:19 +01:00
firestream.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 37 2019-05-24 17:27:11 +02:00
fore200e.c fore200e: Fix incorrect checks of NULL pointer dereference 2020-02-24 08:36:36 +01:00
fore200e.h
he.c atm: he: clean up an indentation issue 2019-09-25 13:54:45 +02:00
he.h
horizon.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 37 2019-05-24 17:27:11 +02:00
horizon.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 37 2019-05-24 17:27:11 +02:00
idt77105.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
idt77105.h
idt77252.c atm: idt77252: Remove call to memset after dma_alloc_coherent 2019-07-15 11:06:27 -07:00
idt77252.h
idt77252_tables.h
iphase.c atm: iphase: Fix Spectre v1 vulnerability 2019-08-02 17:30:36 -07:00
iphase.h
lanai.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
midway.h
nicstar.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
nicstar.h
nicstarmac.c
nicstarmac.copyright
solos-attrlist.c
solos-pci.c atm: Use dev_get_drvdata 2019-07-23 13:02:41 -07:00
suni.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
suni.h
tonga.h
uPD98401.h
uPD98402.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
uPD98402.h
zatm.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
zatm.h
zeprom.h