[alsa-devel] [bug report] ASoC: Intel: Refactor common IPC/mailbox code into generic APIs

Dan Carpenter dan.carpenter at oracle.com
Tue Oct 10 10:14:44 CEST 2017


Hello Jin Yao,

The patch a33c1ec5cf82: "ASoC: Intel: Refactor common IPC/mailbox
code into generic APIs" from Apr 7, 2015, leads to the following
static checker warning:

	sound/soc/intel/common/sst-ipc.c:242 sst_ipc_reply_find_msg()
	error: uninitialized symbol 'mask'.

sound/soc/intel/common/sst-ipc.c
   226  struct ipc_message *sst_ipc_reply_find_msg(struct sst_generic_ipc *ipc,
   227          u64 header)
   228  {
   229          struct ipc_message *msg;
   230          u64 mask;
   231  
   232          if (ipc->ops.reply_msg_match != NULL)
   233                  header = ipc->ops.reply_msg_match(header, &mask);

What should "mask" be initialized to if ops.reply_msg_match is NULL?

   234  
   235          if (list_empty(&ipc->rx_list)) {
   236                  dev_err(ipc->dev, "error: rx list empty but received 0x%llx\n",
   237                          header);
   238                  return NULL;
   239          }
   240  
   241          list_for_each_entry(msg, &ipc->rx_list, list) {
   242                  if ((msg->header & mask) == header)
                             ^^^^^^^^^^^^^^^^^^
Used uninitialized here.

   243                          return msg;
   244          }
   245  
   246          return NULL;
   247  }

regards,
dan carpenter


More information about the Alsa-devel mailing list