Re: [PATCH] powerpc/smp: parse_thread_groups() return error on missing property

From: Sebastian Andrzej Siewior

Date: Sat Nov 14 2026 - 04:36:57 EST


+ Kees, Vlastimil

On 2026-11-14 08:44:57 [+0106], John Ogness wrote:
> parse_thread_groups() is supposed to return -EINVAL if the property
> does not exist and -ENODATA if property does not have a value.
> However, it is currently assuming it exists and blindly calling
> kzalloc_objs() with whatever of_property_count_u32_elems() returns.
>
> Since of_property_count_u32_elems() returns exactly these same error
> values in those cases, simply return with the returned error value.
>
> Signed-off-by: John Ogness <john.ogness@xxxxxxxxxxxxx>

Reviewed-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
Fixes: 0af298e62e5cf ("treewide: refresh kmalloc_obj() conversions")

But… The difference in the commit was:

|- thread_group_array = kcalloc(count, sizeof(u32), GFP_KERNEL);
|+ thread_group_array = kzalloc_objs(u32, count);
| if (!thread_group_array)
| return -ENOMEM;

kcalloc() returned NULL on an overflow and did not continue with the
allocation. So the check below worked.

kzalloc_objs() on the other hand returns for the overflow SIZE_MAX and
passes this down to the allocator. We still get a NULL pointer but with
a warning (from ___kmalloc_large_node()).

Is the warning on purpose now?

Sebastian