Re: [PATCH 1/8] mm: slab: provide krealloc_array()

2020-10-28 Thread Mike Rapoport
On Tue, Oct 27, 2020 at 01:17:18PM +0100, Bartosz Golaszewski wrote: > From: Bartosz Golaszewski > > When allocating an array of elements, users should check for > multiplication overflow or preferably use one of the provided helpers > like: kmalloc_array(). > > There's no krealloc_array() count

[PATCH 1/8] mm: slab: provide krealloc_array()

2020-10-28 Thread Bartosz Golaszewski
From: Bartosz Golaszewski When allocating an array of elements, users should check for multiplication overflow or preferably use one of the provided helpers like: kmalloc_array(). There's no krealloc_array() counterpart but there are many users who use regular krealloc() to reallocate arrays. Le

Re: [PATCH 1/8] mm: slab: provide krealloc_array()

2020-10-27 Thread Vlastimil Babka
On 10/27/20 1:17 PM, Bartosz Golaszewski wrote: From: Bartosz Golaszewski When allocating an array of elements, users should check for multiplication overflow or preferably use one of the provided helpers like: kmalloc_array(). There's no krealloc_array() counterpart but there are many users w