]> git.ipfire.org Git - people/arne_f/kernel.git/commit
staging: greybus: audio: fix uninitialized value issue
authorVaibhav Agarwal <vaibhav.sr@gmail.com>
Fri, 14 Aug 2020 12:33:15 +0000 (18:03 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 23 Sep 2020 08:46:32 +0000 (10:46 +0200)
commit92ded53bd998fb56c36280fa25239b491d66a423
treec06bccb67614313cb0bdbd0c822f32d6e91a5cf5
parent0472aa0c36c7bb3756629a3bbc834604167567f7
staging: greybus: audio: fix uninitialized value issue

commit 1dffeb8b8b4c261c45416d53c75ea51e6ece1770 upstream.

The current implementation for gbcodec_mixer_dapm_ctl_put() uses
uninitialized gbvalue for comparison with updated value. This was found
using static analysis with coverity.

Uninitialized scalar variable (UNINIT)
11. uninit_use: Using uninitialized value
gbvalue.value.integer_value[0].
460        if (gbvalue.value.integer_value[0] != val) {

This patch fixes the issue with fetching the gbvalue before using it for
    comparision.

Fixes: 6339d2322c47 ("greybus: audio: Add topology parser for GB codec")
Reported-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Vaibhav Agarwal <vaibhav.sr@gmail.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/bc4f29eb502ccf93cd2ffd98db0e319fa7d0f247.1597408126.git.vaibhav.sr@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/greybus/audio_topology.c