linux-yocto/tools
Guangshuo Li 8aea9d512c nvdimm: ndtest: Return -ENOMEM if devm_kcalloc() fails in ndtest_probe()
commit a9e6aa9949 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 12:04:21 +02:00
..
accounting tools/getdelays: add backward compatibility for taskstats version 2025-08-02 12:01:41 -07:00
arch objtool/LoongArch: Mark special atomic instruction as INSN_BUG type 2025-09-18 19:43:36 +08:00
bootconfig bootconfig: Fix negative seeks on 32-bit with LFS enabled 2025-08-21 08:16:31 +09:00
bpf bpftool: Add support for dumping streams 2025-07-03 19:30:07 -07:00
build tools: Remove libcrypto dependency 2025-06-26 10:51:41 -07:00
certs
cgroup memcg_slabinfo: Fix use of PG_slab 2025-07-23 11:55:22 +02:00
counter
crypto
debugging
firewire
firmware
gpio tools: gpio: remove the include directory on make clean 2025-09-04 16:29:28 +02:00
hv tools/hv: fcopy: Fix irregularities with size of ring buffer 2025-07-15 06:25:33 +00:00
iio
include tools/nolibc: add stdbool.h to nolibc includes 2025-10-15 12:03:37 +02:00
kvm/kvm_stat
laptop
leds
lib libbpf: Fix error when st-prefix_ops and ops from differ btf 2025-10-15 12:03:38 +02:00
memory-model
mm tools/mm: add script to display page state for a given PID and VADDR 2025-07-09 22:41:53 -07:00
net tools: ynl: fix undefined variable name 2025-10-15 12:03:56 +02:00
objtool objtool/LoongArch: Mark special atomic instruction as INSN_BUG type 2025-09-18 19:43:36 +08:00
pcmcia
perf perf maps: Ensure kmap is set up for all inserts 2025-09-15 10:03:23 -07:00
power ACPICA: Apply ACPI_NONSTRING 2025-10-15 12:03:33 +02:00
rcu
sched tools/sched: Add dl_bw_dump.py for printing bandwidth accounting info 2025-07-14 10:59:33 +02:00
sched_ext sched_ext: Add support for cgroup bandwidth control interface 2025-06-20 17:03:51 -10:00
scripts tools headers: Sync syscall tables with the kernel source 2025-08-18 13:49:25 -07:00
sound
spi
testing nvdimm: ndtest: Return -ENOMEM if devm_kcalloc() fails in ndtest_probe() 2025-10-15 12:04:21 +02:00
thermal
time
tracing rtla/actions: Fix condition for buffer reallocation 2025-09-27 06:01:20 -04:00
usb
verification rv: Add opid per-cpu monitor 2025-07-28 16:47:35 -04:00
virtio
wmi
workqueue
writeback
Makefile