pcm: rate: Fix uninitialized variable warning

The recent gcc warning indicates the uninitialized variable commit_err:
  pcm_rate.c:1104:6: warning: ‘commit_err’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     if (commit_err < 0)
         ^

Add a proper initialization to commit_err.

Fixes: 29041c5220 ("fix infinite draining of the rate plugin in SND_PCM_NONBLOCK mode")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Iwai 2020-05-11 16:31:14 +02:00
parent c04d7bbd6c
commit fa2f20b71e

View file

@ -1051,7 +1051,7 @@ static int snd_pcm_rate_drain(snd_pcm_t *pcm)
/* commit the remaining fraction (if any) */ /* commit the remaining fraction (if any) */
snd_pcm_uframes_t size, ofs, saved_avail_min; snd_pcm_uframes_t size, ofs, saved_avail_min;
snd_pcm_sw_params_t sw_params; snd_pcm_sw_params_t sw_params;
int commit_err; int commit_err = 0;
__snd_pcm_lock(pcm); __snd_pcm_lock(pcm);
/* temporarily set avail_min to one */ /* temporarily set avail_min to one */