WSL2-Linux-Kernel/lib
Wenwen Wang 8d4611f342 test_firmware: fix a memory leak bug
[ Upstream commit d4fddac5a5 ]

In test_firmware_init(), the buffer pointed to by the global pointer
'test_fw_config' is allocated through kzalloc(). Then, the buffer is
initialized in __test_firmware_config_init(). In the case that the
initialization fails, the following execution in test_firmware_init() needs
to be terminated with an error code returned to indicate this failure.
However, the allocated buffer is not freed on this execution path, leading
to a memory leak bug.

To fix the above issue, free the allocated buffer before returning from
test_firmware_init().

Signed-off-by: Wenwen Wang <wenwen@cs.uga.edu>
Link: https://lore.kernel.org/r/1563084696-6865-1-git-send-email-wang6495@umn.edu
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-08-16 10:13:55 +02:00
..
842
fonts
lz4
lzo
mpi lib/mpi: Fix karactx leak in mpi_powm 2019-07-10 09:54:40 +02:00
raid6 ARM: 8833/1: Ensure that NEON code always compiles with Clang 2019-04-05 22:31:34 +02:00
reed_solomon rslib: Fix handling of of caller provided syndrome 2019-07-31 07:28:30 +02:00
xz
zlib_deflate
zlib_inflate
zstd
.gitignore
Kconfig
Kconfig.debug lib/Kconfig.debug: fix build error without CONFIG_BLOCK 2019-05-02 09:40:28 +02:00
Kconfig.kasan
Kconfig.kgdb
Kconfig.ubsan
Makefile x86/mm/mem_encrypt: Disable all instrumentation for early SME setup 2019-05-25 18:25:36 +02:00
argv_split.c
asn1_decoder.c
assoc_array.c assoc_array: Fix shortcut creation 2019-03-23 14:35:14 +01:00
atomic64.c
atomic64_test.c
audit.c
bcd.c
bch.c
bitmap.c
bitrev.c
bsearch.c kprobes: Prohibit probing on bsearch() 2019-04-05 22:31:33 +02:00
btree.c
bug.c
build_OID_registry
bust_spinlocks.c
chacha20.c
check_signature.c
checksum.c
clz_ctz.c
clz_tab.c
cmdline.c
compat_audit.c
cordic.c
cpu_rmap.c
cpumask.c
crc-ccitt.c
crc-itu-t.c
crc-t10dif.c
crc4.c
crc7.c
crc8.c
crc16.c
crc32.c
crc32defs.h
crc32test.c
ctype.c
debug_info.c
debug_locks.c
debugobjects.c debugobjects: avoid recursive calls with kmemleak 2018-12-17 09:28:54 +01:00
dec_and_lock.c
decompress.c
decompress_bunzip2.c
decompress_inflate.c
decompress_unlz4.c
decompress_unlzma.c
decompress_unlzo.c
decompress_unxz.c
devres.c
digsig.c
div64.c lib/div64.c: off by one in shift 2019-04-20 09:15:07 +02:00
dma-debug.c
dma-noop.c
dma-virt.c
dump_stack.c
dynamic_debug.c
dynamic_queue_limits.c
earlycpio.c
errseq.c
extable.c
fault-inject.c
fdt.c
fdt_empty_tree.c
fdt_ro.c
fdt_rw.c
fdt_strerror.c
fdt_sw.c
fdt_wip.c
find_bit.c
flex_array.c
flex_proportions.c
gcd.c
gen_crc32table.c
genalloc.c
glob.c
globtest.c
hexdump.c
hweight.c
idr.c
inflate.c
int_sqrt.c lib/int_sqrt: optimize initial value compute 2019-04-05 22:31:24 +02:00
interval_tree.c
interval_tree_test.c lib/rbtree-test: lower default params 2018-12-17 09:28:55 +01:00
iomap.c
iomap_copy.c
iommu-common.c
iommu-helper.c
ioremap.c
iov_iter.c iov_iter: optimize page_copy_sane() 2019-05-21 18:50:21 +02:00
irq_poll.c
irq_regs.c
is_single_threaded.c
jedec_ddr_data.c
kasprintf.c
kfifo.c
klist.c
kobject.c kobject: Replace strncpy with memcpy 2018-12-08 13:03:35 +01:00
kobject_uevent.c kobject: Don't trigger kobject_uevent(KOBJ_REMOVE) twice. 2019-05-31 06:47:32 -07:00
kstrtox.c
kstrtox.h
lcm.c
libcrc32c.c
list_debug.c
list_sort.c
llist.c
locking-selftest-hardirq.h
locking-selftest-mutex.h
locking-selftest-rlock-hardirq.h
locking-selftest-rlock-softirq.h
locking-selftest-rlock.h
locking-selftest-rsem.h
locking-selftest-rtmutex.h
locking-selftest-softirq.h
locking-selftest-spin-hardirq.h
locking-selftest-spin-softirq.h
locking-selftest-spin.h
locking-selftest-wlock-hardirq.h
locking-selftest-wlock-softirq.h
locking-selftest-wlock.h
locking-selftest-wsem.h
locking-selftest.c
lockref.c
lru_cache.c
memory-notifier-error-inject.c
memweight.c
net_utils.c
netdev-notifier-error-inject.c
nlattr.c
nmi_backtrace.c
nodemask.c
notifier-error-inject.c
notifier-error-inject.h
of-reconfig-notifier-error-inject.c
oid_registry.c
once.c
parman.c
parser.c
pci_iomap.c
percpu-refcount.c
percpu_counter.c
percpu_ida.c
percpu_test.c
plist.c
pm-notifier-error-inject.c
prime_numbers.c
radix-tree.c
random32.c
ratelimit.c
rational.c
rbtree.c
rbtree_test.c lib/rbtree-test: lower default params 2018-12-17 09:28:55 +01:00
reciprocal_div.c
refcount.c
rhashtable.c rhashtable: Still do rehash when we get EEXIST 2019-04-03 06:25:09 +02:00
sbitmap.c sbitmap: fix improper use of smp_mb__before_atomic() 2019-05-31 06:47:10 -07:00
scatterlist.c lib/scatterlist: Fix mapping iterator when sg->offset is greater than PAGE_SIZE 2019-07-31 07:28:37 +02:00
seq_buf.c seq_buf: Make seq_buf_puts() null-terminate the buffer 2019-02-12 19:46:08 +01:00
sg_pool.c
sg_split.c
sha1.c
show_mem.c
siphash.c
smp_processor_id.c
sort.c
stackdepot.c
stmp_device.c
string.c lib/strscpy: Shut up KASAN false-positives in strscpy() 2019-07-31 07:28:44 +02:00
string_helpers.c
strncpy_from_user.c mm/uaccess: Use 'unsigned long' to placate UBSAN warnings on older GCC versions 2019-05-31 06:47:24 -07:00
strnlen_user.c mm/uaccess: Use 'unsigned long' to placate UBSAN warnings on older GCC versions 2019-05-31 06:47:24 -07:00
swiotlb.c swiotlb: clean up reporting 2018-12-13 09:18:52 +01:00
syscall.c
test-kstrtox.c
test-string_helpers.c
test_bitmap.c
test_bpf.c
test_debug_virtual.c lib: fix build failure in CONFIG_DEBUG_VIRTUAL test 2019-01-13 10:01:07 +01:00
test_firmware.c test_firmware: fix a memory leak bug 2019-08-16 10:13:55 +02:00
test_hash.c
test_hexdump.c test_hexdump: use memcpy instead of strncpy 2018-12-08 13:03:35 +01:00
test_kasan.c kasan: remove redundant initialization of variable 'real_size' 2019-05-08 07:20:45 +02:00
test_kmod.c lib/test_kmod.c: potential double free in error handling 2019-03-13 14:03:18 -07:00
test_list_sort.c
test_module.c
test_parman.c
test_printf.c
test_rhashtable.c
test_siphash.c
test_sort.c
test_static_key_base.c
test_static_keys.c
test_sysctl.c
test_user_copy.c
test_uuid.c
textsearch.c
timerqueue.c
ts_bm.c
ts_fsm.c
ts_kmp.c
ubsan.c ubsan: Fix nasty -Wbuiltin-declaration-mismatch GCC-9 warnings 2019-05-10 17:53:08 +02:00
ubsan.h
ucs2_string.c
usercopy.c
uuid.c
vsprintf.c
win_minmax.c
xxhash.c