linux-yocto/tools
Guangshuo Li b808a3590c nvdimm: ndtest: Return -ENOMEM if devm_kcalloc() fails in ndtest_probe()
commit a9e6aa994917ee602798bbb03180a194b37865bb upstream.

devm_kcalloc() may fail. ndtest_probe() allocates three DMA address
arrays (dcr_dma, label_dma, dimm_dma) and later unconditionally uses
them in ndtest_nvdimm_init(), which can lead to a NULL pointer
dereference under low-memory conditions.

Check all three allocations and return -ENOMEM if any allocation fails,
jumping to the common error path. Do not emit an extra error message
since the allocator already warns on allocation failure.

Fixes: 9399ab61ad ("ndtest: Add dimms to the two buses")
Cc: stable@vger.kernel.org
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
Reviewed-by: Alison Schofield <alison.schofield@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-10-15 11:58:09 +02:00
..
accounting
arch x86/rdrand: Disable RDSEED on AMD Cyan Skillfish 2025-07-17 18:35:15 +02:00
bootconfig tools/bootconfig: Fix the wrong format specifier 2025-02-08 09:52:28 +01:00
bpf bpftool: Fix JSON writer resource leak in version command 2025-08-28 16:28:24 +02:00
build perf: build: Setup PKG_CONFIG_LIBDIR for cross compilation 2025-07-17 18:35:11 +02:00
certs
cgroup
counter
crypto/ccp
debugging
edid
firewire
firmware
gpio tools: gpio: remove the include directory on make clean 2025-09-09 18:56:34 +02:00
hv tools: hv: change permissions of NetworkManager configuration file 2024-12-27 13:58:46 +01:00
iio
include tools/nolibc: make time_t robust if __kernel_old_time_t is missing in host headers 2025-10-15 11:57:54 +02:00
kvm/kvm_stat
laptop
leds
lib libbpf: Fix reuse of DEVMAP 2025-10-15 11:57:49 +02:00
memory-model
mm
net/ynl tools: ynl-gen: validate 0 len strings from kernel 2025-06-04 14:42:16 +02:00
objtool objtool: Fix error handling inconsistencies in check() 2025-06-04 14:41:58 +02:00
pci
pcmcia
perf perf bpf-event: Fix use-after-free in synthesis 2025-09-09 18:56:33 +02:00
power cpupower: Fix a bug where the -t option of the set subcommand was not working. 2025-09-09 18:56:20 +02:00
rcu
scripts tools/build: Fix s390(x) cross-compilation with clang 2025-08-28 16:28:17 +02:00
spi
testing nvdimm: ndtest: Return -ENOMEM if devm_kcalloc() fails in ndtest_probe() 2025-10-15 11:58:09 +02:00
thermal
time
tracing rtla/timerlat_top: Set OSNOISE_WORKLOAD for kernel threads 2025-03-07 16:45:49 +01:00
usb
verification tools/rv: Do not skip idle in trace 2025-08-15 12:08:49 +02:00
virtio
wmi
workqueue
Makefile