[PATCH 20/34] iio: inkern: only relase the device node when done with it

Andy Shevchenko andy.shevchenko at gmail.com
Fri Jun 10 07:56:02 PDT 2022


On Fri, Jun 10, 2022 at 10:48 AM Nuno Sá <nuno.sa at analog.com> wrote:
>
> 'of_node_put()' can potentially release the memory pointed to by
> 'iiospec.np' which would leave us with an invalid pointer (and we would
> still pass it in 'of_xlate()'). As such, we can only release the node
> after we are done with it.

The question you should answer in the commit message is the following:
"Can an OF node, attached to a struct device, be gone before the
device itself?" If it so, then patch is good, otherwise there is no
point in this patch in the first place.

-- 
With Best Regards,
Andy Shevchenko



More information about the Linux-mediatek mailing list