axfer/test: fix uninitialized warning

This commit fixes uninitialized return value from a call of test_vector()
to suppress a warning below.

gcc -DHAVE_CONFIG_H -I. -I../../include     -O2 -Wall -pipe -g -MT mapper-test.o -MD -MP -MF .deps/mapper-test.Tpo -c -o mapper-test.o mapper-test.c
mapper-test.c: In function ‘test_vector’:
mapper-test.c:293:6: warning: ‘err’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  int err;
      ^~~

Fixes: 39d1ab8a0c: ('axfer: add a unit test for mapper interface')
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Takashi Sakamoto 2019-05-07 05:47:39 +09:00 committed by Jaroslav Kysela
parent c43a62114a
commit 0248c29757

View file

@ -300,8 +300,10 @@ static int test_vector(struct mapper_trial *trial, snd_pcm_access_t access,
for (i = 0; i < cntr_count; ++i) {
bufs[i] = malloc(size);
if (bufs[i] == NULL)
if (bufs[i] == NULL) {
err = -ENOMEM;
goto end;
}
memset(bufs[i], 0, size);
}