lkml.org 
[lkml]   [2022]   [Oct]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v6 07/10] hda: cs35l41: Add support for CS35L41 in HDA systems
Sorry for resurrecting old thread...

On Thu, Jan 06, 2022 at 02:29:58PM +0200, Andy Shevchenko wrote:
> On Fri, Dec 17, 2021 at 5:45 PM Lucas Tanure
> <tanureal@opensource.cirrus.com> wrote:
> >
> > Add support for CS35L41 using a new separated driver
> > that can be used in all upcoming designs

...

> > + /* No devm_ version as CLSA0100, in no_acpi_dsd case, can't use devm version */
>
> Can you elaborate why devm can't be used?
>
> > + cs35l41->reset_gpio = fwnode_gpiod_get_index(&adev->fwnode, "reset", cs35l41->index,
>
> Please, do not dereference fwnode pointers.
> Also, why can't you use the device instead of fwnode?

We are doing "acpi_dev_put(adev);" a few lines above, so using adev in
the call to fwnode_gpiod_get_index() is technically use-after-free,
isn't it?

Also, why can't we do

cs35l41->reset_gpio = gpiod_get_index(acpi_dev, "reset",
cs35l41->index,
GPIOD_OUT_LOW);

since acpi_dev is device structure corresponding to adev and we are
getting the rest of the properties from it?

I saw downthread that there was supposed to be a patch addressing
several issues raised by Andy, was it ever submitted?

Thanks.

--
Dmitry

\
 
 \ /
  Last update: 2022-10-31 06:39    [W:0.136 / U:0.312 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site