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:   Fri, 21 Jan 2022 14:56:09 +0000
From:   Jonathan Cameron <Jonathan.Cameron@...wei.com>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
CC:     Jonathan Cameron <jic23@...nel.org>,
        Cristian Pop <cristian.pop@...log.com>,
        <linux-iio@...r.kernel.org>, <linux-gpio@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>, <devicetree@...r.kernel.org>,
        <robh+dt@...nel.org>
Subject: Re: [PATCH v2 2/2] one-bit-adc-dac: Add initial version of one bit
 ADC-DAC

On Tue, 18 Jan 2022 19:06:20 +0200
Andy Shevchenko <andy.shevchenko@...il.com> wrote:

> On Mon, Jan 17, 2022 at 8:41 AM Jonathan Cameron <jic23@...nel.org> wrote:
> > On Tue, 11 Jan 2022 13:59:19 +0200
> > Cristian Pop <cristian.pop@...log.com> wrote:  
> 
> > > +     st->labels = devm_kzalloc(device, sizeof(*st->labels) * child_num, GFP_KERNEL);
> > > +     if (!st->labels)
> > > +             return -ENOMEM;
> > > +
> > > +     i = child_num;
> > > +     fwnode_for_each_child_node(fwnode, child) {
> > > +             if (fwnode_property_read_u32(child, "reg", &crt_ch))
> > > +                     continue;
> > > +
> > > +             if (crt_ch >= num_channels)
> > > +                     continue;
> > > +
> > > +             if (fwnode_property_read_string(child, "label", &label))
> > > +                     continue;
> > > +
> > > +             chan = &channels[crt_ch];  
> > ? Not used.
> >  
> > > +             st->labels[--i] = label;  
> 
> > I've no idea how this works...  Should be looking for the chan->channel
> > value as that's what your read uses to index.  
> 
> It's an implicit memcpy().

Not that.  What I don't follow is how it ends up in the right element of
st->labels[] seeing as i has nothing to do with reg which should
be the channel number.  Far as I can see it's setting the labels
in a random order.

Jonathan

> 
> > > +     }
> > > +
> > > +     return 0;
> > > +}  
> 
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ