Return-path: Received: from mail-pf0-f172.google.com ([209.85.192.172]:33087 "EHLO mail-pf0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750975AbcC3KPI (ORCPT ); Wed, 30 Mar 2016 06:15:08 -0400 Received: by mail-pf0-f172.google.com with SMTP id 4so38806969pfd.0 for ; Wed, 30 Mar 2016 03:15:08 -0700 (PDT) From: Wei-Ning Huang To: Linux Wireless Cc: LKML , djkurtz@chromium.org, snanda@chromium.org, akarwar@marvell.com, Wei-Ning Huang Subject: [PATCH RESEND] mwifiex: fix NULL pointer dereference error Date: Wed, 30 Mar 2016 18:14:55 +0800 Message-Id: <1459332895-4563-1-git-send-email-wnhuang@chromium.org> (sfid-20160330_121533_879071_8059866C) Sender: linux-wireless-owner@vger.kernel.org List-ID: In mwifiex_enable_hs, we need to check if priv->wdev.wiphy->wowlan_config is NULL before accessing it's member. This sometimes cause kernel panic when suspend/resume. Signed-off-by: Wei-Ning Huang --- drivers/net/wireless/marvell/mwifiex/sta_ioctl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c b/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c index d5c56eb..d8de432 100644 --- a/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c +++ b/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c @@ -509,7 +509,8 @@ int mwifiex_enable_hs(struct mwifiex_adapter *adapter) if (priv && priv->sched_scanning) { #ifdef CONFIG_PM - if (!priv->wdev.wiphy->wowlan_config->nd_config) { + if (priv->wdev.wiphy->wowlan_config && + !priv->wdev.wiphy->wowlan_config->nd_config) { #endif mwifiex_dbg(adapter, CMD, "aborting bgscan!\n"); mwifiex_stop_bg_scan(priv); -- 2.1.2