All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/9] slab: provide and use krealloc_array()
@ 2020-11-09 11:06 ` Bartosz Golaszewski
  0 siblings, 0 replies; 34+ messages in thread
From: Bartosz Golaszewski @ 2020-11-09 11:06 UTC (permalink / raw)
  To: Andy Shevchenko, Sumit Semwal, Gustavo Padovan,
	Christian König, Mauro Carvalho Chehab, Borislav Petkov,
	Tony Luck, James Morse, Robert Richter, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Daniel Vetter,
	Alexander Shishkin, Linus Walleij, Michael S . Tsirkin,
	Jason Wang, Christoph Lameter, Pekka Enberg, David Rientjes,
	Joonsoo Kim, Andrew Morton, Jaroslav Kysela, Takashi Iwai
  Cc: linux-media, dri-devel, linaro-mm-sig, linux-kernel, linux-edac,
	linux-gpio, kvm, virtualization, netdev, linux-mm, alsa-devel,
	Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

Andy brought to my attention the fact that users allocating an array of
equally sized elements should check if the size multiplication doesn't
overflow. This is why we have helpers like kmalloc_array().

However we don't have krealloc_array() equivalent and there are many
users who do their own multiplication when calling krealloc() for arrays.

This series provides krealloc_array() and uses it in a couple places.

A separate series will follow adding devm_krealloc_array() which is
needed in the xilinx adc driver.

v1 -> v2:
- added a kernel doc for krealloc_array()
- mentioned krealloc et al in the docs
- collected review tags

v2 -> v3:
- add a patch improving krealloc()'s kerneldoc
- fix a typo
- improve .rst doc
- tweak line breaks

Bartosz Golaszewski (9):
  mm: slab: clarify krealloc()'s behavior with __GFP_ZERO
  mm: slab: provide krealloc_array()
  ALSA: pcm: use krealloc_array()
  vhost: vringh: use krealloc_array()
  pinctrl: use krealloc_array()
  edac: ghes: use krealloc_array()
  drm: atomic: use krealloc_array()
  hwtracing: intel: use krealloc_array()
  dma-buf: use krealloc_array()

 Documentation/core-api/memory-allocation.rst |  4 ++++
 drivers/dma-buf/sync_file.c                  |  3 +--
 drivers/edac/ghes_edac.c                     |  4 ++--
 drivers/gpu/drm/drm_atomic.c                 |  3 ++-
 drivers/hwtracing/intel_th/msu.c             |  2 +-
 drivers/pinctrl/pinctrl-utils.c              |  2 +-
 drivers/vhost/vringh.c                       |  3 ++-
 include/linux/slab.h                         | 18 ++++++++++++++++++
 mm/slab_common.c                             |  6 +++---
 sound/core/pcm_lib.c                         |  4 ++--
 10 files changed, 36 insertions(+), 13 deletions(-)

-- 
2.29.1


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

end of thread, other threads:[~2020-11-11  8:01 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-09 11:06 [PATCH v3 0/9] slab: provide and use krealloc_array() Bartosz Golaszewski
2020-11-09 11:06 ` Bartosz Golaszewski
2020-11-09 11:06 ` Bartosz Golaszewski
2020-11-09 11:06 ` [PATCH v3 1/9] mm: slab: clarify krealloc()'s behavior with __GFP_ZERO Bartosz Golaszewski
2020-11-09 11:06   ` Bartosz Golaszewski
2020-11-09 11:06   ` Bartosz Golaszewski
2020-11-09 11:06 ` [PATCH v3 2/9] mm: slab: provide krealloc_array() Bartosz Golaszewski
2020-11-09 11:06   ` Bartosz Golaszewski
2020-11-09 11:06   ` Bartosz Golaszewski
2020-11-09 11:06 ` [PATCH v3 3/9] ALSA: pcm: use krealloc_array() Bartosz Golaszewski
2020-11-09 11:06   ` Bartosz Golaszewski
2020-11-09 11:06   ` Bartosz Golaszewski
2020-11-09 11:06 ` [PATCH v3 4/9] vhost: vringh: " Bartosz Golaszewski
2020-11-09 11:06   ` Bartosz Golaszewski
2020-11-09 11:06   ` Bartosz Golaszewski
2020-11-09 11:06 ` [PATCH v3 5/9] pinctrl: " Bartosz Golaszewski
2020-11-09 11:06   ` Bartosz Golaszewski
2020-11-09 11:06   ` Bartosz Golaszewski
2020-11-10 14:48   ` Linus Walleij
2020-11-10 14:48     ` Linus Walleij
2020-11-10 14:48     ` Linus Walleij
2020-11-10 14:48     ` Linus Walleij
2020-11-09 11:06 ` [PATCH v3 6/9] edac: ghes: " Bartosz Golaszewski
2020-11-09 11:06   ` Bartosz Golaszewski
2020-11-09 11:06   ` Bartosz Golaszewski
2020-11-09 11:06 ` [PATCH v3 7/9] drm: atomic: " Bartosz Golaszewski
2020-11-09 11:06   ` Bartosz Golaszewski
2020-11-09 11:06   ` Bartosz Golaszewski
2020-11-09 11:06 ` [PATCH v3 8/9] hwtracing: intel: " Bartosz Golaszewski
2020-11-09 11:06   ` Bartosz Golaszewski
2020-11-09 11:06   ` Bartosz Golaszewski
2020-11-09 11:06 ` [PATCH v3 9/9] dma-buf: " Bartosz Golaszewski
2020-11-09 11:06   ` Bartosz Golaszewski
2020-11-09 11:06   ` Bartosz Golaszewski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.