lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 29 Jun 2022 11:42:22 -0500
From:   Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
To:     Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
        broonie@...nel.org
Cc:     alsa-devel@...a-project.org, lgirdwood@...il.com,
        linux-kernel@...r.kernel.org, tiwai@...e.com
Subject: Re: [PATCH 2/4] ASoC: codecs: add wsa883x amplifier support


>>> +static int wsa883x_update_status(struct sdw_slave *slave,
>>> +                 enum sdw_slave_status status)
>>> +{
>>> +    struct wsa883x_priv *wsa883x = dev_get_drvdata(&slave->dev);
>>> +
>>> +    if (status == SDW_SLAVE_ATTACHED && slave->dev_num > 0)
>>
>> do you actually need to test if slave->dev_num is > 0?
>>
> Few years back I think it was you who asked me to add this check.. :-)
> 
> https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg2073074.html

Oops!

My comment was valid in general but at the bus level. With the benefit
of hindsight, I don't think this comment is valid in this callback.

update_status is either called with UNATTACHED, or with ATTACHED/ALERT
after programming dev_num to a value > 0.

It's not wrong to leave the code as is, but it's likely to be an
always-true condition.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ