summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJanusz Krzysztofik <jmkrzyszt@gmail.com>2018-11-07 22:30:31 +0100
committerBen Hutchings <ben@decadent.org.uk>2019-02-11 17:53:54 +0000
commit2503d5a4ca8577881a1f02f7d33e65b27c61e6cc (patch)
treeafb2a09b9f554fede139ef5d4d132b2c03540104 /arch
parent820682e9979a5b312187867865a39cf788b79009 (diff)
downloadlinux-stable-2503d5a4ca8577881a1f02f7d33e65b27c61e6cc.tar.gz
linux-stable-2503d5a4ca8577881a1f02f7d33e65b27c61e6cc.tar.bz2
linux-stable-2503d5a4ca8577881a1f02f7d33e65b27c61e6cc.zip
ARM: OMAP1: ams-delta: Fix possible use of uninitialized field
commit cec83ff1241ec98113a19385ea9e9cfa9aa4125b upstream. While playing with initialization order of modem device, it has been discovered that under some circumstances (early console init, I believe) its .pm() callback may be called before the uart_port->private_data pointer is initialized from plat_serial8250_port->private_data, resulting in NULL pointer dereference. Fix it by checking for uninitialized pointer before using it in modem_pm(). Fixes: aabf31737a6a ("ARM: OMAP1: ams-delta: update the modem to use regulator API") Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-omap1/board-ams-delta.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c
index 2aab761ee68d..a5e9a80077a9 100644
--- a/arch/arm/mach-omap1/board-ams-delta.c
+++ b/arch/arm/mach-omap1/board-ams-delta.c
@@ -511,6 +511,9 @@ static void modem_pm(struct uart_port *port, unsigned int state, unsigned old)
{
struct modem_private_data *priv = port->private_data;
+ if (!priv)
+ return;
+
if (IS_ERR(priv->regulator))
return;