Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: gus: Fix erroneous memory allocation

snd_gf1_mem_xalloc() returns NULL incorrectly when the memory chunk is
allocated in the middle of the chain. This patch corrects the return
value to treat it properly.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20211213132444.22385-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>

+1 -1
+1 -1
sound/isa/gus/gus_mem.c
··· 44 44 else 45 45 nblock->prev->next = nblock; 46 46 mutex_unlock(&alloc->memory_mutex); 47 - return NULL; 47 + return nblock; 48 48 } 49 49 pblock = pblock->next; 50 50 }