ALSA: pcm: Fix return code in pcm_native.c
authorSachin Kamat <sachin.kamat@linaro.org>
Wed, 21 Nov 2012 09:06:55 +0000 (14:36 +0530)
committerTakashi Iwai <tiwai@suse.de>
Wed, 21 Nov 2012 09:43:35 +0000 (10:43 +0100)
Return the value obtained from snd_pcm_hw_constraint_minmax() instead
of -EINVAL. Silences the following smatch warning:
sound/core/pcm_native.c:2003 snd_pcm_hw_constraints_complete() info:
why not propagate 'err' from snd_pcm_hw_constraint_minmax() instead of -22?

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/pcm_native.c

index c76f6375a96b218012b111f72cb9aa64cdee6514..09b4286c65f9d7d6e7ab8abed498ad2d7f96e737 100644 (file)
@@ -2000,7 +2000,7 @@ int snd_pcm_hw_constraints_complete(struct snd_pcm_substream *substream)
        if (runtime->dma_bytes) {
                err = snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 0, runtime->dma_bytes);
                if (err < 0)
-                       return -EINVAL;
+                       return err;
        }
 
        if (!(hw->rates & (SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_CONTINUOUS))) {