Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c810f903 authored by Takashi Iwai's avatar Takashi Iwai
Browse files

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: default avatarTakashi Iwai <tiwai@suse.de>
parent ac190c76
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;