ARM: omap2+: hwmod: fix potential NULL pointer access
authorTero Kristo <t-kristo@ti.com>
Tue, 20 Jul 2021 18:47:10 +0000 (11:47 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Aug 2021 11:22:17 +0000 (13:22 +0200)
commit3d7d2d2b069bdc736d491cb989d3d00483e4e9e6
tree2416779d5f4d0ef1ba81ffd4ea4e43d1b9a2c00f
parent9851ad2f71075448ac22a6b01be2ac33b5fc737c
ARM: omap2+: hwmod: fix potential NULL pointer access

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@ti.com>
Signed-off-by: Tero Kristo <t-kristo@ti.com>
Cc: stable@vger.kernel.org # v5.10+
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/mach-omap2/omap_hwmod.c