Skip to content

Commit

Permalink
ALSA: gus: Fix erroneous memory allocation
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
tiwai committed Dec 13, 2021
1 parent 78977fd commit c2f5141
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/isa/gus/gus_mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit c2f5141

Please sign in to comment.