From 78ab3c8db5b92ed0537a8b18b16a842b53fe0ce0 Mon Sep 17 00:00:00 2001 From: Alexander Boettcher Date: Thu, 19 Nov 2020 13:20:51 +0100 Subject: [PATCH] usb: avoid memset on failed memory allocation Issue #3953 --- repos/dde_linux/src/include/lx_emul/impl/slab.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/repos/dde_linux/src/include/lx_emul/impl/slab.h b/repos/dde_linux/src/include/lx_emul/impl/slab.h index abf0699879..575b10a25d 100644 --- a/repos/dde_linux/src/include/lx_emul/impl/slab.h +++ b/repos/dde_linux/src/include/lx_emul/impl/slab.h @@ -30,6 +30,9 @@ void *kmalloc(size_t size, gfp_t flags) ? Lx::Malloc::dma().alloc(size) : Lx::Malloc::mem().alloc(size); + if (!addr) + return 0; + if ((Genode::addr_t)addr & 0x3) Genode::error("unaligned kmalloc ", (Genode::addr_t)addr);