summaryrefslogtreecommitdiff
path: root/axfer
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2019-05-07 05:47:39 +0900
committerJaroslav Kysela <perex@perex.cz>2019-05-07 08:32:53 +0200
commit0248c297575c5fab52e80ca6a6ed944ce586d185 (patch)
treea1ba65bf1dda285d67f3e3643d7a3f283ae86ba2 /axfer
parentc43a62114ac0f49af4d54a7559afac89c7f54618 (diff)
downloadalsa-utils-0248c297575c5fab52e80ca6a6ed944ce586d185.tar.gz
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: 39d1ab8a0cb4: ('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>
Diffstat (limited to 'axfer')
-rw-r--r--axfer/test/mapper-test.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/axfer/test/mapper-test.c b/axfer/test/mapper-test.c
index 9f005aa..3dfcf50 100644
--- a/axfer/test/mapper-test.c
+++ b/axfer/test/mapper-test.c
@@ -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);
}