ALSA: xen-front: Do not use stream buffer size before it is set
authorOleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Thu, 4 Apr 2019 12:38:38 +0000 (15:38 +0300)
committerTakashi Iwai <tiwai@suse.de>
Thu, 4 Apr 2019 12:44:18 +0000 (14:44 +0200)
This fixes the regression introduced while moving to Xen shared
buffer implementation.

Fixes: 58f9d806d16a ("ALSA: xen-front: Use Xen common shared buffer implementation")
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: <stable@vger.kernel.org> # v5.0+
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/xen/xen_snd_front_alsa.c

index a7f413cb704dc7154c42c5adf29ed242d632cfc2..b14ab512c2ce0d4ef2aceae5d673e6b528e1120c 100644 (file)
@@ -441,7 +441,7 @@ static int shbuf_setup_backstore(struct xen_snd_front_pcm_stream_info *stream,
 {
        int i;
 
 {
        int i;
 
-       stream->buffer = alloc_pages_exact(stream->buffer_sz, GFP_KERNEL);
+       stream->buffer = alloc_pages_exact(buffer_sz, GFP_KERNEL);
        if (!stream->buffer)
                return -ENOMEM;
 
        if (!stream->buffer)
                return -ENOMEM;