Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1367074 > unrolled thread

[PATCH RESEND] mwifiex: fix NULL pointer dereference error

Started byWei-Ning Huang <wnhuang@chromium.org>
First post2016-03-30 12:20 +0200
Last post2016-03-30 14:20 +0200
Articles 6 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH RESEND] mwifiex: fix NULL pointer dereference error Wei-Ning Huang <wnhuang@chromium.org> - 2016-03-30 12:20 +0200
    Re: [PATCH RESEND] mwifiex: fix NULL pointer dereference error Sedat Dilek <sedat.dilek@gmail.com> - 2016-03-30 12:30 +0200
      Re: [PATCH RESEND] mwifiex: fix NULL pointer dereference error Wei-Ning Huang <wnhuang@google.com> - 2016-03-30 12:40 +0200
        Re: [PATCH RESEND] mwifiex: fix NULL pointer dereference error Sedat Dilek <sedat.dilek@gmail.com> - 2016-03-30 12:50 +0200
        Re: [PATCH RESEND] mwifiex: fix NULL pointer dereference error Kalle Valo <kvalo@codeaurora.org> - 2016-03-30 14:10 +0200
          Re: [PATCH RESEND] mwifiex: fix NULL pointer dereference error Wei-Ning Huang <wnhuang@google.com> - 2016-03-30 14:20 +0200

#1367074 — [PATCH RESEND] mwifiex: fix NULL pointer dereference error

FromWei-Ning Huang <wnhuang@chromium.org>
Date2016-03-30 12:20 +0200
Subject[PATCH RESEND] mwifiex: fix NULL pointer dereference error
Message-ID<riloe-3NH-25@gated-at.bofh.it>
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 <wnhuang@chromium.org>
---
 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

[toc] | [next] | [standalone]


#1367075

FromSedat Dilek <sedat.dilek@gmail.com>
Date2016-03-30 12:30 +0200
Message-ID<rilxT-3RR-1@gated-at.bofh.it>
In reply to#1367074
On Wed, Mar 30, 2016 at 12:14 PM, Wei-Ning Huang <wnhuang@chromium.org> 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 <wnhuang@chromium.org>
> ---
>  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

[toc] | [prev] | [next] | [standalone]


#1367085

FromWei-Ning Huang <wnhuang@google.com>
Date2016-03-30 12:40 +0200
Message-ID<rilHA-3WZ-27@gated-at.bofh.it>
In reply to#1367075
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 <sedat.dilek@gmail.com> wrote:
> On Wed, Mar 30, 2016 at 12:14 PM, Wei-Ning Huang <wnhuang@chromium.org> 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 <wnhuang@chromium.org>
>> ---
>>  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

[toc] | [prev] | [next] | [standalone]


#1367091

FromSedat Dilek <sedat.dilek@gmail.com>
Date2016-03-30 12:50 +0200
Message-ID<rilRf-40o-1@gated-at.bofh.it>
In reply to#1367085
On Wed, Mar 30, 2016 at 12:38 PM, Wei-Ning Huang <wnhuang@google.com> wrote:
> ah.. thanks.
>
> Kalle, can you help amend the message if this patch is accepted?
> Thanks a lot.
>

http://its-not-its.info/

- Sedat -

> Wei-Ning
>
> On Wed, Mar 30, 2016 at 6:26 PM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
>> On Wed, Mar 30, 2016 at 12:14 PM, Wei-Ning Huang <wnhuang@chromium.org> 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 <wnhuang@chromium.org>
>>> ---
>>>  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

[toc] | [prev] | [next] | [standalone]


#1367152

FromKalle Valo <kvalo@codeaurora.org>
Date2016-03-30 14:10 +0200
Message-ID<rin6H-57W-35@gated-at.bofh.it>
In reply to#1367085
Wei-Ning Huang <wnhuang@google.com> writes:

> Kalle, can you help amend the message if this patch is accepted?

Sure, I'll fix the typo in the commit log.

But please try to avoid top posting, it makes it more difficult to
follow the threads.

-- 
Kalle Valo

[toc] | [prev] | [next] | [standalone]


#1367156

FromWei-Ning Huang <wnhuang@google.com>
Date2016-03-30 14:20 +0200
Message-ID<ringm-5c9-3@gated-at.bofh.it>
In reply to#1367152
On Wed, Mar 30, 2016 at 8:00 PM, Kalle Valo <kvalo@codeaurora.org> wrote:
> Wei-Ning Huang <wnhuang@google.com> writes:
>
>> Kalle, can you help amend the message if this patch is accepted?
>
> Sure, I'll fix the typo in the commit log.
>
> But please try to avoid top posting, it makes it more difficult to
> follow the threads.
>
> --
> Kalle Valo

Noted, thanks for the reminder :)

Wei-Ning


-- 
Wei-Ning Huang, 黃偉寧 | Software Engineer, Google Inc., Taiwan |
wnhuang@google.com | Cell: +886 910-380678

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web