Linux kernel staging patches
 help / color / mirror / Atom feed
* [PATCH v3 0/3] staging: media: atomisp: use kvmalloc_objs() and drop redundant OOM messages
@ 2026-06-23 22:09 Rodrigo Gobbi
  2026-06-23 22:09 ` [PATCH v3 1/3] staging: media: atomisp: use kvmalloc_objs() in make_histogram() Rodrigo Gobbi
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Rodrigo Gobbi @ 2026-06-23 22:09 UTC (permalink / raw)
  To: andy, hansg, mchehab, sakari.ailus, gregkh, feng
  Cc: ~lkcamp/patches, linux-kernel-mentees, linux-kernel, linux-media,
	linux-staging

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@innora.ai/
[2] https://github.com/torvalds/linux/commit/d178c7ca8fefc28115d35b94c3b1f4d653e34182
[3] https://lore.kernel.org/all/20260609215110.118860-1-rodrigo.gobbi.7@gmail.com/
---
Changelog:
v3: keep original author chain/tags at v2 and v3; minor cnt usage at v2 for readability;
v2: https://lore.kernel.org/all/20260622224402.34001-1-rodrigo.gobbi.7@gmail.com/
v1: https://lore.kernel.org/all/20260609215110.118860-1-rodrigo.gobbi.7@gmail.com/
---
Feng Ning (1):
  staging: media: atomisp: use kvmalloc_objs() for overflow-safe
    allocation

Rodrigo Gobbi (2):
  staging: media: atomisp: use kvmalloc_objs() in make_histogram()
  staging: media: atomisp: drop redundant out-of-memory messages

 .../media/atomisp/pci/sh_css_metrics.c        |  11 +-
 .../media/atomisp/pci/sh_css_param_dvs.c      |   5 -
 .../staging/media/atomisp/pci/sh_css_params.c | 101 +++++++-----------
 3 files changed, 41 insertions(+), 76 deletions(-)

-- 
2.48.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-06-25  7:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-23 22:09 [PATCH v3 0/3] staging: media: atomisp: use kvmalloc_objs() and drop redundant OOM messages Rodrigo Gobbi
2026-06-23 22:09 ` [PATCH v3 1/3] staging: media: atomisp: use kvmalloc_objs() in make_histogram() Rodrigo Gobbi
2026-06-23 22:09 ` [PATCH v3 2/3] staging: media: atomisp: use kvmalloc_objs() for overflow-safe allocation Rodrigo Gobbi
2026-06-25  7:14   ` Andy Shevchenko
2026-06-23 22:09 ` [PATCH v3 3/3] staging: media: atomisp: drop redundant out-of-memory messages Rodrigo Gobbi
2026-06-25  7:14 ` [PATCH v3 0/3] staging: media: atomisp: use kvmalloc_objs() and drop redundant OOM messages Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox