Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1152804imm; Wed, 1 Aug 2018 11:03:33 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcRgl++781tRZszv6y7sTMqsTS2hP0v7epNukEiZJYozaVRoW/JLA8Rd36dsesmgG5m+/HX X-Received: by 2002:a65:498c:: with SMTP id r12-v6mr26060917pgs.112.1533146613889; Wed, 01 Aug 2018 11:03:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533146613; cv=none; d=google.com; s=arc-20160816; b=Rwe5h7kSy9SWpWvczWkdhxcA4+0u27fbslcRpGJw3vUenlW3ZFx0AeaxfXL5AduWG1 t6Fgeo1uAq6VqPbqy5ukeqMbPX2kEO2kaqh8kOIIf5v+3dh/OkZ/dU6NUvIyG3p/qO87 rqT4oY5yxwh0XS9mBXryAwdqxqB5+gRTqYepPjmQ/VHX2aJ9w8VjNNbQNjbO1kfIO0ph KVhTlduFZSLiYuCTyqpoLvyfzxpfbEEbraRh6JMjFe/p0jGJIIC+sYsNHeCkczgW0494 d4IfHLvkmSXj54NWv6NqET13jSTxLagB19gXnPfRddZ/30BBoEHixu1R+h9oOUxzozq6 3HXw== 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=iDhpUm4GEKYIZ8LOhilwiajB+jMXMPPomH9fwGrLRgk=; b=VFWxM5DuLSAxJZCpxhJcc2UmbLKiJ5mejvsUAHx1R9/CZ18tE2ErB0s2CNWZXsU3M6 FH3+yi1ZLFj1QdJdZqvcYj3ZnxZbraUuU08Vxx4bw0cVd0KqxenIiipWZgWPLDtrqPOY 5gCcp82sxglVJ5Y7vhSDU9kvoeG8vJ9VLwVBJi6zAJz4oaLfDVk5i5QhS+fIKjrkl2Wi pxKfijTOGcPyWzNWmPOF/SlKt+shDs2qMIk+Wkp2KozSr9hvTu5WrLkdEAirRo0ai8KG s83+nayjkb4y9/rE18vM4St+1S0gEpbOSr9Ynpk+IuvyDehm9THlHGCrF1GG/YQO0AvP 2TiQ== 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 68-v6si17577497pff.55.2018.08.01.11.03.19; Wed, 01 Aug 2018 11:03:33 -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 S1732679AbeHATs7 (ORCPT + 99 others); Wed, 1 Aug 2018 15:48:59 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:50224 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405874AbeHATIi (ORCPT ); Wed, 1 Aug 2018 15:08:38 -0400 Received: from localhost (D57E6652.static.ziggozakelijk.nl [213.126.102.82]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id A90E81386; Wed, 1 Aug 2018 17:15:41 +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.14 078/246] wlcore: sdio: check for valid platform device data before suspend Date: Wed, 1 Aug 2018 18:49:48 +0200 Message-Id: <20180801165015.443828594@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180801165011.700991984@linuxfoundation.org> References: <20180801165011.700991984@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.14-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 @@ -406,6 +406,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);