[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <a1ce2e69-d93a-93e8-8bbf-07c27e52124f@intel.com>
Date: Tue, 27 Aug 2019 21:18:37 +0200
From: Cezary Rojewski <cezary.rojewski@...el.com>
To: Amadeusz Sławiński
<amadeuszx.slawinski@...ux.intel.com>
Cc: alsa-devel@...a-project.org, Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>,
Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>,
Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>,
Jie Yang <yang.jie@...ux.intel.com>,
linux-kernel@...r.kernel.org,
Amadeusz Sławiński
<amadeuszx.slawinski@...el.com>
Subject: Re: [PATCH 2/6] ASoC: Intel: Fix use of potentially uninitialized
variable
On 2019-08-27 16:17, Amadeusz Sławiński wrote:
> From: Amadeusz Sławiński <amadeuszx.slawinski@...el.com>
>
> If ipc->ops.reply_msg_match is NULL, we may end up using uninitialized
> mask value.
>
> reported by smatch:
> sound/soc/intel/common/sst-ipc.c:266 sst_ipc_reply_find_msg() error: uninitialized symbol 'mask'.
>
> Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@...el.com>
> ---
> sound/soc/intel/common/sst-ipc.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/sound/soc/intel/common/sst-ipc.c b/sound/soc/intel/common/sst-ipc.c
> index 1186a03a88d6..6068bb697e22 100644
> --- a/sound/soc/intel/common/sst-ipc.c
> +++ b/sound/soc/intel/common/sst-ipc.c
> @@ -223,6 +223,8 @@ struct ipc_message *sst_ipc_reply_find_msg(struct sst_generic_ipc *ipc,
>
> if (ipc->ops.reply_msg_match != NULL)
> header = ipc->ops.reply_msg_match(header, &mask);
> + else
> + mask = (u64)-1;
Please see linux/limits.h and check if this can't be replaced by an
equivalent found there.
>
> if (list_empty(&ipc->rx_list)) {
> dev_err(ipc->dev, "error: rx list empty but received 0x%llx\n",
>
Powered by blists - more mailing lists