diff options
| author | Jean-Sébastien Pédron <dumbbell@FreeBSD.org> | 2026-04-14 00:00:23 +0000 |
|---|---|---|
| committer | Jean-Sébastien Pédron <dumbbell@FreeBSD.org> | 2026-04-21 22:18:26 +0000 |
| commit | 2434fcfd0dd07847a8518351b4525ec488f4d0bd (patch) | |
| tree | 8e611248453124d773a423904a62c972f6cf7d86 /sys/compat/linuxkpi/common | |
| parent | bbd20c0795a7df35fc665165bf5f17d7f6533e54 (diff) | |
Diffstat (limited to 'sys/compat/linuxkpi/common')
| -rw-r--r-- | sys/compat/linuxkpi/common/src/linux_slab.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/compat/linuxkpi/common/src/linux_slab.c b/sys/compat/linuxkpi/common/src/linux_slab.c index 96fe74dcd40d..a387e5c23ad3 100644 --- a/sys/compat/linuxkpi/common/src/linux_slab.c +++ b/sys/compat/linuxkpi/common/src/linux_slab.c @@ -250,6 +250,11 @@ lkpi_krealloc(const void *ptr, size_t size, gfp_t flags) if (ptr == NULL) return (kmalloc(size, flags)); + if (size == 0) { + kfree(ptr); + return (ZERO_SIZE_PTR); + } + osize = ksize(ptr); if (size <= osize) return (__DECONST(void *, ptr)); |
