Re: [PATCH v3 0/3] staging: media: atomisp: use kvmalloc_objs() and drop redundant OOM messages

From: Andy Shevchenko

Date: Thu Jun 25 2026 - 03:15:23 EST


On Tue, Jun 23, 2026 at 07:09:25PM -0300, Rodrigo Gobbi wrote:
> Several allocations in the atomisp driver still size their buffers with
> open-coded multiplication, e.g. width * height * sizeof(*p). When the
> dimensions are large the product can silently wrap, causing kvmalloc()
> to allocate an undersized buffer.
>
> Convert the remaining sites to kvmalloc_objs() with array_size(), which
> saturate to SIZE_MAX on overflow so kvmalloc() returns NULL instead of
> allocating too few bytes.
>
> This continues the work started in commit [2], and picks up the stalled
> sites from [1], unifying with [3].
>
> While here, drop the redundant IA_CSS_ERROR("out of memory") messages on
> the touched allocation paths: the memory management core already emits a
> far more detailed warning on allocation failure as raised at [1].
>
> [1] https://lore.kernel.org/all/20260413112904.98864-1-feng@xxxxxxxxx/
> [2] https://github.com/torvalds/linux/commit/d178c7ca8fefc28115d35b94c3b1f4d653e34182

FWIW, since it's in tree, you can refer to it in usual way:
d178c7ca8fef ("staging: media: atomisp: use array3_size() for overflow-safe allocation")

> [3] https://lore.kernel.org/all/20260609215110.118860-1-rodrigo.gobbi.7@xxxxxxxxx/

Anyways, the whole series is good, thanks!
Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>

--
With Best Regards,
Andy Shevchenko