Message ID | 20181123171956.9236-2-tiwai@suse.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [1/2] ALSA: wss: Fix invalid snd_free_pages() at error path | expand |
On Fri, Nov 23, 2018 at 06:19:56PM +0100, Takashi Iwai wrote: > Some spurious calls of snd_free_pages() have been overlooked and > remain in the error paths of sparc cs4231 driver code. Since > runtime->dma_area is managed by the PCM core helper, we shouldn't > release manually. > > Drop the superfluous calls. > > Cc: <stable@vger.kernel.org> > Signed-off-by: Takashi Iwai <tiwai@suse.de> > --- > sound/sparc/cs4231.c | 8 ++------ > 1 file changed, 2 insertions(+), 6 deletions(-) > > diff --git a/sound/sparc/cs4231.c b/sound/sparc/cs4231.c > index e73c962590eb..079063d8038d 100644 > --- a/sound/sparc/cs4231.c > +++ b/sound/sparc/cs4231.c > @@ -1146,10 +1146,8 @@ static int snd_cs4231_playback_open(struct snd_pcm_substream *substream) > runtime->hw = snd_cs4231_playback; > > err = snd_cs4231_open(chip, CS4231_MODE_PLAY); > - if (err < 0) { > - snd_free_pages(runtime->dma_area, runtime->dma_bytes); > + if (err < 0) > return err; > - } > chip->playback_substream = substream; > chip->p_periods_sent = 0; > snd_pcm_set_sync(substream); > @@ -1167,10 +1165,8 @@ static int snd_cs4231_capture_open(struct snd_pcm_substream *substream) > runtime->hw = snd_cs4231_capture; > > err = snd_cs4231_open(chip, CS4231_MODE_RECORD); > - if (err < 0) { > - snd_free_pages(runtime->dma_area, runtime->dma_bytes); > + if (err < 0) > return err; > - } > chip->capture_substream = substream; > chip->c_periods_sent = 0; > snd_pcm_set_sync(substream); > -- > 2.19.1 Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Regards Takashi Sakamoto > _______________________________________________ > Alsa-devel mailing list > Alsa-devel@alsa-project.org > http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
diff --git a/sound/sparc/cs4231.c b/sound/sparc/cs4231.c index e73c962590eb..079063d8038d 100644 --- a/sound/sparc/cs4231.c +++ b/sound/sparc/cs4231.c @@ -1146,10 +1146,8 @@ static int snd_cs4231_playback_open(struct snd_pcm_substream *substream) runtime->hw = snd_cs4231_playback; err = snd_cs4231_open(chip, CS4231_MODE_PLAY); - if (err < 0) { - snd_free_pages(runtime->dma_area, runtime->dma_bytes); + if (err < 0) return err; - } chip->playback_substream = substream; chip->p_periods_sent = 0; snd_pcm_set_sync(substream); @@ -1167,10 +1165,8 @@ static int snd_cs4231_capture_open(struct snd_pcm_substream *substream) runtime->hw = snd_cs4231_capture; err = snd_cs4231_open(chip, CS4231_MODE_RECORD); - if (err < 0) { - snd_free_pages(runtime->dma_area, runtime->dma_bytes); + if (err < 0) return err; - } chip->capture_substream = substream; chip->c_periods_sent = 0; snd_pcm_set_sync(substream);
Some spurious calls of snd_free_pages() have been overlooked and remain in the error paths of sparc cs4231 driver code. Since runtime->dma_area is managed by the PCM core helper, we shouldn't release manually. Drop the superfluous calls. Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> --- sound/sparc/cs4231.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)