linux-yocto/tools
Guangshuo Li e4a1e3e881 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 12:00:23 +02:00
..
accounting
arch objtool/LoongArch: Mark special atomic instruction as INSN_BUG type 2025-09-25 11:13:45 +02:00
bootconfig
bpf bpftool: Fix JSON writer resource leak in version command 2025-08-20 18:30:38 +02:00
build tools/build: Don't pass test log files to linker 2025-05-29 11:02:08 +02:00
certs
cgroup memcg_slabinfo: Fix use of PG_slab 2025-08-15 12:13:46 +02:00
counter
crypto
debugging
firewire
firmware
gpio tools: gpio: remove the include directory on make clean 2025-09-09 18:58:25 +02:00
hv tools/hv: fcopy: Fix irregularities with size of ring buffer 2025-08-20 18:30:56 +02:00
iio
include tools/nolibc: make time_t robust if __kernel_old_time_t is missing in host headers 2025-10-15 12:00:02 +02:00
kvm/kvm_stat
laptop
leds
lib libbpf: Fix error when st-prefix_ops and ops from differ btf 2025-10-15 12:00:04 +02:00
memory-model
mm
net tools: ynl-gen: validate 0 len strings from kernel 2025-05-29 11:03:12 +02:00
objtool objtool/LoongArch: Mark special atomic instruction as INSN_BUG type 2025-09-25 11:13:45 +02:00
pci
pcmcia
perf perf bpf-utils: Harden get_bpf_prog_info_linear 2025-09-09 18:58:25 +02:00
power cpupower: Fix a bug where the -t option of the set subcommand was not working. 2025-09-09 18:58:02 +02:00
rcu
sched_ext
scripts tools/build: Fix s390(x) cross-compilation with clang 2025-08-20 18:30:24 +02:00
sound
spi
testing nvdimm: ndtest: Return -ENOMEM if devm_kcalloc() fails in ndtest_probe() 2025-10-15 12:00:23 +02:00
thermal
time
tracing rtla: Check pkg-config install 2025-09-04 15:31:42 +02:00
usb
verification tools/rv: Do not skip idle in trace 2025-08-15 12:13:46 +02:00
virtio
wmi
workqueue
writeback
Makefile