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] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 11 Dec 2017 22:48:31 +0530
From:   Vinod Koul <vinod.koul@...el.com>
To:     Takashi Iwai <tiwai@...e.de>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        LKML <linux-kernel@...r.kernel.org>,
        ALSA <alsa-devel@...a-project.org>, Mark <broonie@...nel.org>,
        Pierre <pierre-louis.bossart@...ux.intel.com>,
        patches.audio@...el.com, alan@...ux.intel.com,
        Charles Keepax <ckeepax@...nsource.cirrus.com>,
        Sagar Dharia <sdharia@...eaurora.org>,
        srinivas.kandagatla@...aro.org, plai@...eaurora.org,
        Sudheer Papothi <spapothi@...eaurora.org>
Subject: Re: [PATCH v5 04/15] soundwire: Add MIPI DisCo property helpers

On Mon, Dec 11, 2017 at 06:06:30PM +0100, Takashi Iwai wrote:
> On Mon, 11 Dec 2017 18:00:22 +0100,
> Vinod Koul wrote:
> > 
> > On Mon, Dec 11, 2017 at 05:10:17PM +0100, Takashi Iwai wrote:
> > > On Wed, 06 Dec 2017 16:47:00 +0100,
> > > Vinod Koul wrote:
> > > > 
> > > > +		/* TODO: Read audio mode */
> > > > +
> > > > +		i++;
> > > > +	}
> > > 
> > > Don't we use count argument for a sanity check?
> > 
> > Not really as that iterator runs on each bit:
> > 
> > for_each_set_bit(bit, &addr, 32) {
> > 
> > so it will not go on endlessly and can max out when all the bits being set
> > and stop.
> 
> Yes, that shouldn't happen.  OTOH, only looking at the callee side,
> one may wonder that the possible error would be dpn[] overflows the
> given array size (=count).  Though, looking at both caller and callee,
> one realizes that it shouldn't happen, too.

Right :)

> (But then again wonders why passing count argument at all :)

So we allocate memory for dpn ports by using hweight32(), and then
fill up this memory by reading properties. Count here is used to access
dpn[i] and fill data for each port from firmware and hence incremented
every time..

-- 
~Vinod

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ