From 2ddd3e0c78a3446d227892002a648a744668988b Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Fri, 21 Apr 2017 20:57:38 +0200 Subject: [PATCH] afh_recv: Check return value of afh_get_chunk(). Starting with commit b6b571e6c (afh: Dynamic chunks) the function returns an int value and may fail. Although we store the return value in a variable, the value of the variable is never read, causing the clang static analyzer to complain (rightfully). This patch modifies afh_recv_post_select() to fail if afh_get_chunk() returns negative. --- afh_recv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/afh_recv.c b/afh_recv.c index 08f0d1e7..1eac9a5b 100644 --- a/afh_recv.c +++ b/afh_recv.c @@ -232,6 +232,8 @@ static int afh_recv_post_select(__a_unused struct sched *s, void *context) pard->audio_format_num, pard->map, pard->map_size, &start, &size, &pard->afh_context); + if (ret < 0) + goto out; PARA_DEBUG_LOG("adding chunk %u\n", pard->current_chunk); btr_add_output_dont_free(start, size, btrn); if (pard->current_chunk >= pard->last_chunk) { -- 2.39.5