Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1378572imm; Sat, 4 Aug 2018 02:09:50 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcRXvoEYmQtqnOYuQCCaq74mPHf+bj0keSpuyXFx1FXOgIJQwGLO3bHwc9B/i3gfmw3YsOX X-Received: by 2002:a63:2b89:: with SMTP id r131-v6mr6786999pgr.39.1533373790345; Sat, 04 Aug 2018 02:09:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533373790; cv=none; d=google.com; s=arc-20160816; b=HrDA3zbAA1zUADm+RxEXgorZXAzVQ9hpbWw0hUtK77y9B7dhZTZ04u77TLjXv8FVkK yJVNVxiH+Xp5ehnoQFWc9/J8L5gpvPsGz2LKNTP3mSCFFbYV86TrQEW1N0sl+34OyNbc UKxX+72cMoLBEiZVh5M0WYNyiGsd9Fl6Y0AFpaxmbfh944cmjUzv2i2xR8V8YUDEEMUO Jvwc9dnwby7gN1ECCdhSvbxG2k6bWqxDCX1SAklaBKE7LShlJ66i9pTnSTwjXCPvD6bK NJpFUZsRKjBW6mArvCFTGY4aQITm2wK1El2/tmLzN03SWquYa1By32KbB3ylHeY0dXl9 VQgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=M323nGi216YDzhsNecqr3YUioABXn4i0tjJU0uIvjcY=; b=IA4NiT2xGkK9OA0WcC64cLU0ML34Zixm8QOL0ICnBczmkBkiOMwqC25xAQAIA2k1dF tOLvNjtfxAfOWHqjhHeF+E0tJ9EvfLZxt20qO1fGob2BBGI46vRXuTIFpDuZuo8as2W3 x//Mne8PzX8R/OctR2jalt++GBm9uH4M9hgEGSGaQ8+Kh7YerSLlItV2CYEZ1DLvDgan gunDJjH5kvelo9xTeasRflbkA8x51rkb1jgQ6jbsvApIBENPb155g2nqmctAeDakNFkC Wx24XmrP2eKpZEZGvWrSr6S8iTufMKsCGreH0L/VdgLP6t1sucX6i0aoppW1IclmEji+ Yp0w== ARC-Authentication-Results: i=1; mx.google.com; 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 x4-v6si5666454pgr.167.2018.08.04.02.09.36; Sat, 04 Aug 2018 02:09:50 -0700 (PDT) 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; 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 S2387680AbeHDLHv (ORCPT + 99 others); Sat, 4 Aug 2018 07:07:51 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:49460 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726754AbeHDLHu (ORCPT ); Sat, 4 Aug 2018 07:07:50 -0400 Received: from localhost (D57E6652.static.ziggozakelijk.nl [213.126.102.82]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id DCC49BB3; Sat, 4 Aug 2018 09:07:51 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eyal Reizer , Kalle Valo , Sasha Levin Subject: [PATCH 4.4 032/124] wlcore: sdio: check for valid platform device data before suspend Date: Sat, 4 Aug 2018 11:00:21 +0200 Message-Id: <20180804082703.639219270@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180804082702.434482435@linuxfoundation.org> References: <20180804082702.434482435@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Eyal Reizer [ Upstream commit 6e91d48371e79862ea2c05867aaebe4afe55a865 ] the wl pointer can be null In case only wlcore_sdio is probed while no WiLink module is successfully probed, as in the case of mounting a wl12xx module while using a device tree file configured with wl18xx related settings. In this case the system was crashing in wl1271_suspend() as platform device data is not set. Make sure wl the pointer is valid before using it. Signed-off-by: Eyal Reizer Signed-off-by: Kalle Valo Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/ti/wlcore/sdio.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/drivers/net/wireless/ti/wlcore/sdio.c +++ b/drivers/net/wireless/ti/wlcore/sdio.c @@ -388,6 +388,11 @@ static int wl1271_suspend(struct device mmc_pm_flag_t sdio_flags; int ret = 0; + if (!wl) { + dev_err(dev, "no wilink module was probed\n"); + goto out; + } + dev_dbg(dev, "wl1271 suspend. wow_enabled: %d\n", wl->wow_enabled);