mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-04 04:06:26 +00:00
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>
This commit is contained in:
parent
78977fd5b1
commit
c2f5141540
@ -44,7 +44,7 @@ static struct snd_gf1_mem_block *snd_gf1_mem_xalloc(struct snd_gf1_mem * alloc,
|
||||
else
|
||||
nblock->prev->next = nblock;
|
||||
mutex_unlock(&alloc->memory_mutex);
|
||||
return NULL;
|
||||
return nblock;
|
||||
}
|
||||
pblock = pblock->next;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user