usb: avoid memset on failed memory allocation

Issue #3953
This commit is contained in:
Alexander Boettcher 2020-11-19 13:20:51 +01:00 committed by Christian Helmuth
parent ffdd49f9ce
commit 78ab3c8db5

View File

@ -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);