Re: [PATCH] mm: add missing alloc_percpu() NULL check in hotplug init

Hongfu Li <[email protected]>
Newsgroups org.kernel.vger.linux-cxl,org.kernel.vger.linux-kernel,org.kvack.linux-mm
Message-ID <[email protected]>
On 7/17/26 2:46 PM, Mike Rapoport wrote:
> On Fri, Jul 17, 2026 at 01:29:38PM +0800, Hongfu Li wrote:
>> From: Hongfu Li <[email protected]>
>>
>> No NULL check is done for alloc_percpu() when initializing per-CPU
>> nodestats. Allocation failure leads to NULL pointer dereference
>> during later memset.
>>
>> Make function return int, check alloc_percpu() result and return
>> -ENOMEM on error. The caller chain already propagates this error
>> correctly.
> I already applied a fix from Gregory:
>
> https://patch.msgid.link/[email protected]
>
> It'll be unstreamed soon.

Got it, I'll drop this patch as Gregory's fix is already on the way 
upstream.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.