Re: [PATCH 4/9] mmc: meson-mx-sdio: fix OF child-node lookup
From: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Date: 2018-08-23 18:50:36
Also in:
lkml, stable
From: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Date: 2018-08-23 18:50:36
Also in:
lkml, stable
Hi Johan, On Wed, Aug 22, 2018 at 12:57 PM Johan Hovold [off-list ref] wrote:
Use the new of_get_compatible_child() helper to lookup the slot child node instead of using of_find_compatible_node(), which searches the entire tree and thus can return an unrelated (i.e. non-child) node.
that new helper is much appreciated, thank you!
This also addresses a potential use-after-free (e.g. after probe deferral) as the tree-wide helper drops a reference to its first argument (i.e. the node of the device being probed). While at it, also fix up the related slot-node reference leak.
not sure why both issues went unnoticed so far - good that they're now both fixed. thank you!
Fixes: ed80a13bb4c4 ("mmc: meson-mx-sdio: Add a driver for the Amlogic Meson8 and Meson8b SoCs")
Cc: stable <redacted> # 4.15backporting only works if the patch introducing of_get_compatible_child is also backported do we have to inform Greg somehow?
Cc: Carlo Caione <redacted> Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Cc: Ulf Hansson <redacted> Signed-off-by: Johan Hovold <johan@kernel.org>
Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Regards Martin