[bug report] ASoC: amd: acp: ACP code generic to support newer platforms

Dan Carpenter dan.carpenter at oracle.com
Wed Jul 13 13:37:43 CEST 2022


Hello V sujith kumar Reddy,

This is a semi-automatic email about new static checker warnings.

The patch b24484c18b10: "ASoC: amd: acp: ACP code generic to support 
newer platforms" from Jul 7, 2022, leads to the following Smatch 
complaint:

    sound/soc/amd/acp/acp-platform.c:99 i2s_irq_handler()
    warn: variable dereferenced before check 'adata' (see line 94)

sound/soc/amd/acp/acp-platform.c
    93		struct acp_dev_data *adata = data;
    94		struct acp_resource *rsrc = adata->rsrc;
                                            ^^^^^^^^^^^
The patch adds a new dereference

    95		struct acp_stream *stream;
    96		u16 i2s_flag = 0;
    97		u32 val, val1, i;
    98	
    99		if (!adata)
                    ^^^^^^
The old code assumed that "adata" could be NULL but hopefully that
check can be removed?

   100			return IRQ_NONE;
   101	

regards,
dan carpenter


More information about the Alsa-devel mailing list