]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
linuxkpi: Add `krealloc_array()`
authorJean-Sébastien Pédron <dumbbell@FreeBSD.org>
Fri, 11 Nov 2022 17:37:34 +0000 (18:37 +0100)
committerJean-Sébastien Pédron <dumbbell@FreeBSD.org>
Fri, 11 Nov 2022 17:37:34 +0000 (18:37 +0100)
commit1ad6b2b1daa8937b2e1ced43802adba5734ba92b
treea093396a536ca3b72abf97ed3652d29ba349e457
parent0b8a423d073309ab5f24501c2f6b3f6b2cd8f422
linuxkpi: Add `krealloc_array()`

In FreeBSD, this is a wrapper on top of `realloc()`.

V2: Check if `n * size` would overflow and return `NULL` if that's the
    case. Suggested by hselasky@ and emaste@.

Reviewed by: manu
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D36959
sys/compat/linuxkpi/common/include/linux/slab.h