linux/drivers/staging/vt6655
Nam Cao 2a2db520e3 staging: vt6655: fix some erroneous memory clean-up loops
In some initialization functions of this driver, memory is allocated with
'i' acting as an index variable and increasing from 0. The commit in
"Fixes" introduces some clean-up codes in case of allocation failure,
which free memory in reverse order with 'i' decreasing to 0. However,
there are some problems:
  - The case i=0 is left out. Thus memory is leaked.
  - In case memory allocation fails right from the start, the memory
    freeing loops will start with i=-1 and invalid memory locations will
    be accessed.

One of these loops has been fixed in commit c8ff915358 ("staging:
vt6655: fix potential memory leak"). Fix the remaining erroneous loops.

Link: https://lore.kernel.org/linux-staging/Yx9H1zSpxmNqx6Xc@kadam/
Fixes: 5341ee0adb ("staging: vt6655: check for memory allocation failures")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Signed-off-by: Nam Cao <namcaov@gmail.com>
Link: https://lore.kernel.org/r/20220912170429.29852-1-namcaov@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-24 13:05:24 +02:00
..
baseband.c staging: vt6655: Replace macro MACvSetRFLE_LatchBase 2022-08-30 17:17:49 +02:00
baseband.h staging: vt6655: Rename by_preamble_type parameter 2021-10-20 19:36:29 +02:00
card.c staging: vt6655: Cleanup and rename function MACvSetCurrTXDescAddr 2022-09-11 13:58:45 +02:00
card.h staging: vt6655: Replace unused return value of vt6655_get_current_tsf 2022-05-05 23:21:04 +02:00
channel.c staging: vt6655: Rename macro MACvSelectPage1 2022-08-30 17:17:48 +02:00
channel.h
desc.h staging: vt6655: Remove filenames in files 2021-08-28 09:45:10 +02:00
device_cfg.h
device_main.c staging: vt6655: fix some erroneous memory clean-up loops 2022-09-24 13:05:24 +02:00
device.h staging: vt6655: drop off byRxMode var in device.h 2021-12-28 17:10:47 +01:00
dpc.c staging: vt6655: refactor camelcase uCurrRSSI to current_rssi 2021-12-03 15:08:30 +01:00
dpc.h
Kconfig
key.c staging: vt6655: Delete tmacro.h 2022-04-20 18:39:47 +02:00
key.h
mac.c staging: vt6655: Rename function MACvSetCurrAC0DescAddrEx 2022-09-11 13:58:45 +02:00
mac.h staging: vt6655: Rename function MACvSetCurrAC0DescAddrEx 2022-09-11 13:58:45 +02:00
Makefile
power.c staging: vt6655: Rename MACvRegBitsOff 2022-07-14 15:48:38 +02:00
power.h staging: vt6655: Remove filenames in files 2021-08-28 09:45:10 +02:00
rf.c staging: vt6655: Rename MACvWordRegBitsOff 2022-07-14 15:48:38 +02:00
rf.h staging: vt6655: Rename RFvWriteWakeProgSyn function 2021-11-17 13:55:32 +01:00
rxtx.c Staging driver patches for 6.0-rc1 2022-08-04 12:01:42 -07:00
rxtx.h staging: vt6655: Remove filenames in files 2021-08-28 09:45:10 +02:00
srom.c staging: vt6655: Delete upc.h 2022-06-06 07:58:41 +02:00
srom.h staging: vt6655: Remove filenames in files 2021-08-28 09:45:10 +02:00
test
TODO