[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <68d5691882202_245a5429471@iweiny-mobl.notmuch>
Date: Thu, 25 Sep 2025 11:08:56 -0500
From: Ira Weiny <ira.weiny@...el.com>
To: Guangshuo Li <lgs201920130244@...il.com>, Dan Williams
<dan.j.williams@...el.com>, Vishal Verma <vishal.l.verma@...el.com>, "Dave
Jiang" <dave.jiang@...el.com>, Ira Weiny <ira.weiny@...el.com>, "Santosh
Sivaraj" <santosh@...six.org>, <nvdimm@...ts.linux.dev>,
<linux-kernel@...r.kernel.org>
CC: <stable@...r.kernel.org>
Subject: Re: [PATCH v3] nvdimm: ndtest: Return -ENOMEM if devm_kcalloc()
fails in ndtest_probe()
Guangshuo Li wrote:
> 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: 9399ab61ad82 ("ndtest: Add dimms to the two buses")
> Cc: stable@...r.kernel.org
> Signed-off-by: Guangshuo Li <lgs201920130244@...il.com>
Reviewed-by: Ira Weiny <ira.weiny@...el.com>
[snip]
Powered by blists - more mailing lists