[PATCH] ASoC: mt8365: Fix using uninitialized value "i2s_data" issue

Mark Brown broonie at kernel.org
Wed Sep 11 04:41:15 PDT 2024


On Wed, Sep 11, 2024 at 07:36:33PM +0800, Qianqiang Liu wrote:
> On Wed, Sep 11, 2024 at 11:52:58AM +0100, Mark Brown wrote:
> > On Wed, Sep 11, 2024 at 08:15:17AM +0800, Qianqiang Liu wrote:

> > >  	spin_lock_irqsave(&afe_priv->afe_ctrl_lock, flags);

> > > +	if (!i2s_data) {
> > > +		spin_unlock_irqrestore(&afe_priv->afe_ctrl_lock, flags);
> > > +		return;
> > > +	}

> > Why would we look up i2s_data without the lock, take the lock, then
> > check if we actually found it?  That doesn't seem right.

> Just check the "i2s_data" is NULL or not.

That doesn't address my question at all.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-mediatek/attachments/20240911/d011ed3d/attachment.sig>


More information about the Linux-mediatek mailing list