2014-04-23 21:41:12

by Bing Zhao

[permalink] [raw]
Subject: [PATCH] mwifiex: fix adapter pointer dereference

drivers/net/wireless/mwifiex/pcie.c:2252 mwifiex_pcie_fw_dump_work()
error: we previously assumed 'adapter' could be null (see line 2251)

Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: Bing Zhao <[email protected]>
---
drivers/net/wireless/mwifiex/pcie.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/mwifiex/pcie.c b/drivers/net/wireless/mwifiex/pcie.c
index 51989b3..249fdbd 100644
--- a/drivers/net/wireless/mwifiex/pcie.c
+++ b/drivers/net/wireless/mwifiex/pcie.c
@@ -2248,7 +2248,7 @@ static void mwifiex_pcie_fw_dump_work(struct work_struct *work)
};

if (!adapter) {
- dev_err(adapter->dev, "Could not dump firmwware info\n");
+ pr_err("adapter is null. Could not dump firmware info\n");
return;
}

--
1.8.2.3



2014-04-25 01:45:17

by John W. Linville

[permalink] [raw]
Subject: Re: [PATCH] mwifiex: fix adapter pointer dereference

I reverted the patch in question already. If you rewrite it, please
be sure to account for this fix as appropriate.

Thanks,

John

On Wed, Apr 23, 2014 at 02:40:53PM -0700, Bing Zhao wrote:
> drivers/net/wireless/mwifiex/pcie.c:2252 mwifiex_pcie_fw_dump_work()
> error: we previously assumed 'adapter' could be null (see line 2251)
>
> Reported-by: Dan Carpenter <[email protected]>
> Signed-off-by: Bing Zhao <[email protected]>
> ---
> drivers/net/wireless/mwifiex/pcie.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/mwifiex/pcie.c b/drivers/net/wireless/mwifiex/pcie.c
> index 51989b3..249fdbd 100644
> --- a/drivers/net/wireless/mwifiex/pcie.c
> +++ b/drivers/net/wireless/mwifiex/pcie.c
> @@ -2248,7 +2248,7 @@ static void mwifiex_pcie_fw_dump_work(struct work_struct *work)
> };
>
> if (!adapter) {
> - dev_err(adapter->dev, "Could not dump firmwware info\n");
> + pr_err("adapter is null. Could not dump firmware info\n");
> return;
> }
>
> --
> 1.8.2.3
>
>

--
John W. Linville Someday the world will need a hero, and you
[email protected] might be all we have. Be ready.