WSL2-Linux-Kernel/drivers/staging/vt6655
Nam Cao ff8551d411 staging: vt6655: fix potential memory leak
[ Upstream commit c8ff915358 ]

In function device_init_td0_ring, memory is allocated for member
td_info of priv->apTD0Rings[i], with i increasing from 0. In case of
allocation failure, the memory is freed in reversed order, with i
decreasing to 0. However, the case i=0 is left out and thus memory is
leaked.

Modify the memory freeing loop to include the case i=0.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Signed-off-by: Nam Cao <namcaov@gmail.com>
Link: https://lore.kernel.org/r/20220909141338.19343-1-namcaov@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-10-26 12:35:47 +02:00
..
Kconfig
Makefile
TODO
baseband.c
baseband.h
card.c
card.h
channel.c
channel.h
desc.h
device.h
device_cfg.h
device_main.c
dpc.c
dpc.h
key.c
key.h
mac.c
mac.h
power.c
power.h
rf.c
rf.h
rxtx.c
rxtx.h
srom.c
srom.h
test
tmacro.h
upc.h