Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752270AbcC3KjE (ORCPT ); Wed, 30 Mar 2016 06:39:04 -0400 Received: from mail-ob0-f173.google.com ([209.85.214.173]:33897 "EHLO mail-ob0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751999AbcC3KjC convert rfc822-to-8bit (ORCPT ); Wed, 30 Mar 2016 06:39:02 -0400 MIME-Version: 1.0 In-Reply-To: References: <1459332895-4563-1-git-send-email-wnhuang@chromium.org> Date: Wed, 30 Mar 2016 18:38:31 +0800 Message-ID: Subject: Re: [PATCH RESEND] mwifiex: fix NULL pointer dereference error From: Wei-Ning Huang To: sedat.dilek@gmail.com Cc: Linux Wireless , LKML , Daniel Kurtz , snanda@chromium.org, Amitkumar Karwar , Kalle Valo Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1774 Lines: 50 ah.. thanks. Kalle, can you help amend the message if this patch is accepted? Thanks a lot. Wei-Ning On Wed, Mar 30, 2016 at 6:26 PM, Sedat Dilek wrote: > On Wed, Mar 30, 2016 at 12:14 PM, Wei-Ning Huang wrote: >> In mwifiex_enable_hs, we need to check if >> priv->wdev.wiphy->wowlan_config is NULL before accessing it's member. > > it's... its member (not it's) :-). > > - Sedat - > >> 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 >> >> -- >> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in >> the body of a message to majordomo@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html -- Wei-Ning Huang, 黃偉寧 | Software Engineer, Google Inc., Taiwan | wnhuang@google.com | Cell: +886 910-380678