This is a note to let you know that I've just added the patch titled ARM: omap2+: hwmod: fix potential NULL pointer access to the 5.13-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: arm-omap2-hwmod-fix-potential-null-pointer-access.patch and it can be found in the queue-5.13 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From b070f9ca78680486927b799cf6126b128a7c2c1b Mon Sep 17 00:00:00 2001 From: Tero Kristo <t-kristo@xxxxxx> Date: Tue, 20 Jul 2021 11:47:10 -0700 Subject: ARM: omap2+: hwmod: fix potential NULL pointer access From: Tero Kristo <t-kristo@xxxxxx> commit b070f9ca78680486927b799cf6126b128a7c2c1b upstream. omap_hwmod_get_pwrdm() may access a NULL clk_hw pointer in some failure cases. Add a check for the case and bail out gracely if this happens. Reported-by: Dan Murphy <dmurphy@xxxxxx> Signed-off-by: Tero Kristo <t-kristo@xxxxxx> Cc: stable@xxxxxxxxxxxxxxx # v5.10+ Signed-off-by: Kevin Hilman <khilman@xxxxxxxxxxxx> Signed-off-by: Tony Lindgren <tony@xxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- arch/arm/mach-omap2/omap_hwmod.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c @@ -3776,6 +3776,7 @@ struct powerdomain *omap_hwmod_get_pwrdm struct omap_hwmod_ocp_if *oi; struct clockdomain *clkdm; struct clk_hw_omap *clk; + struct clk_hw *hw; if (!oh) return NULL; @@ -3792,7 +3793,14 @@ struct powerdomain *omap_hwmod_get_pwrdm c = oi->_clk; } - clk = to_clk_hw_omap(__clk_get_hw(c)); + hw = __clk_get_hw(c); + if (!hw) + return NULL; + + clk = to_clk_hw_omap(hw); + if (!clk) + return NULL; + clkdm = clk->clkdm; if (!clkdm) return NULL; Patches currently in stable-queue which might be from t-kristo@xxxxxx are queue-5.13/arm-omap2-hwmod-fix-potential-null-pointer-access.patch