Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2011830imu; Fri, 14 Dec 2018 04:29:32 -0800 (PST) X-Google-Smtp-Source: AFSGD/XMpooA4bDRUGgQ8ihRAdBjhoqt6Fp7hS94n5qnrfXm4LxFZn4OadsltZKX0dfpy/SXtS6G X-Received: by 2002:a62:f5da:: with SMTP id b87mr2672934pfm.253.1544790572050; Fri, 14 Dec 2018 04:29:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544790572; cv=none; d=google.com; s=arc-20160816; b=eZKC1szJBJQhvnfivs7oZcMAV3sqdh96UY3Xm1C29z04lzVfufW3DeJw3akxCb9Q+Z ffdYpuFCqNlHWQbT8oaVzamuvT1IErQbMDPXm24KlbkSfe+HJ3BTtgEZatiRJb2K5Dz0 K5xk+B5DqodWJ5vLaeJdgXMy41qjCCJNUg7nlZ7oD4vONmod83Kmi8oeH1OkqunVushO KnSoQej/fkYHpvtuacgW4A+jpq2hR/HHbUgljqrqc3bb3nSWn+9cOLfKl6VQGzP4obf5 yYhGRHJX2Kft/kXnUQhwMBTzCKl6+xaROMW6Klse/LFIB8HbbBpqU2eRXYlJtxFFeLNT BjSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=aC7NTWYl68UVhj602T8vsutGsRAy6ceSe/2fZ/VE60k=; b=VlexbxNSSJl+5SPW96VpCHTUBFT/3UBh7x88LiM/SKFBQnh1DBHxT7ZMQvEsisAyH1 2tobBDXValod4XK7iVYjtsrk3HaI3AVtdRgdgQPEUvRxp70q2c3Y+nw9G3MhliRcVX6q tzBUhGBjL1ntgAIjGVLUHpD/s0IZsrRtvC2yI8zfo8KqBRdqYtDXBJ6KLM3gkqg3vdDz NAzlIptBg0sP2cj8nr1n1nQvcGL5j1pmgZ7e7S2vinz/S6XwG94+N3oDfztGeAGHV4iI 65qFnNVj4zN0185WydbhWi3LLpQLdteVPldW78UkERRMRvolbx7HpQ9EPKvQm8w+QgD5 pYRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=h1Qbdh25; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b30si4236760pla.285.2018.12.14.04.29.17; Fri, 14 Dec 2018 04:29:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=h1Qbdh25; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731514AbeLNMLf (ORCPT + 99 others); Fri, 14 Dec 2018 07:11:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:58236 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731260AbeLNMLa (ORCPT ); Fri, 14 Dec 2018 07:11:30 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A7ABD21104; Fri, 14 Dec 2018 12:11:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544789490; bh=tzmnZHjnAkQPNGKx9ZOHi9DRaihGdiCfE6FfiSeveKQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h1Qbdh25xsWRsnhhKF9olPQU8DvaoAKUdSdyd6pfpjGzVxA3LsevfGa5za+Fh4jFB RYbTwnzzW17cRIb6c0jz7QNIKDnzsxmgh4MV78wHzZBqSLldZ548aRWGalz8OKy7BW UGvnIHuQRxOl22KeAdtyMfAPpgD2boPJKtmmtj8k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Janusz Krzysztofik , Tony Lindgren , Sasha Levin Subject: [PATCH 4.9 13/51] ARM: OMAP1: ams-delta: Fix possible use of uninitialized field Date: Fri, 14 Dec 2018 13:00:15 +0100 Message-Id: <20181214115714.522010480@linuxfoundation.org> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20181214115713.244259772@linuxfoundation.org> References: <20181214115713.244259772@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit cec83ff1241ec98113a19385ea9e9cfa9aa4125b ] 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 Signed-off-by: Tony Lindgren Signed-off-by: Sasha Levin --- arch/arm/mach-omap1/board-ams-delta.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c index 6613a6ff5dbc..c4b634c54fbd 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; -- 2.19.1