diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-08-03 12:48:32 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-08-03 12:48:32 +0200 |
commit | c810f9039f040681ec9d9f2983b748c193037297 (patch) | |
tree | 9c60a5f46538233ab41f97cdf42fb9b33a4af7b1 /sound/core | |
parent | Merge tag 'asoc-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie... (diff) | |
download | linux-c810f9039f040681ec9d9f2983b748c193037297.tar.xz linux-c810f9039f040681ec9d9f2983b748c193037297.zip |
ALSA: PCM: Fix possible memory leaks in the error path
When the first page allocation failed for sgbuf, it leaks the records
that have been formerly allocated.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core')
-rw-r--r-- | sound/core/sgbuf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/core/sgbuf.c b/sound/core/sgbuf.c index 4e7ec2b49873..d0f00356fc11 100644 --- a/sound/core/sgbuf.c +++ b/sound/core/sgbuf.c @@ -101,7 +101,7 @@ void *snd_malloc_sgbuf_pages(struct device *device, if (snd_dma_alloc_pages_fallback(SNDRV_DMA_TYPE_DEV, device, chunk, &tmpb) < 0) { if (!sgbuf->pages) - return NULL; + goto _failed; if (!res_size) goto _failed; size = sgbuf->pages * PAGE_SIZE; |