2011-02-12 15:01:05

by Stanislav Fomichev

[permalink] [raw]
Subject: [PATCH] brcm80211: remove multiple calls to wl_release_fw

This causes an oops when the bcm43xx_hdr-0.fw binary is not found.

Signed-off-by: Stanislav Fomichev <[email protected]>
---
drivers/staging/brcm80211/sys/wl_mac80211.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/brcm80211/sys/wl_mac80211.c b/drivers/staging/brcm80211/sys/wl_mac80211.c
index cd8392b..5faa521 100644
--- a/drivers/staging/brcm80211/sys/wl_mac80211.c
+++ b/drivers/staging/brcm80211/sys/wl_mac80211.c
@@ -1767,7 +1767,6 @@ static int wl_request_fw(struct wl_info *wl, struct pci_dev *pdev)
if (status) {
printf("%s: fail to load firmware %s\n",
KBUILD_MODNAME, fw_name);
- wl_release_fw(wl);
return status;
}
WL_NONE("request fw %s\n", fw_name);
@@ -1777,7 +1776,6 @@ static int wl_request_fw(struct wl_info *wl, struct pci_dev *pdev)
if (status) {
printf("%s: fail to load firmware %s\n",
KBUILD_MODNAME, fw_name);
- wl_release_fw(wl);
return status;
}
wl->fw.hdr_num_entries[i] =
--
1.7.1


2011-02-14 20:40:56

by Roland Vossen

[permalink] [raw]
Subject: Re: [PATCH] brcm80211: remove multiple calls to wl_release_fw

Hello Dan and Stanislav,

I already had a patch in the making that is a superset of Stanislav's
patch. It fixes the leak issue. I agreed with Stanislav's patch since, I
made the same (but: more) changes. Stanislav, can we agree that we wait
for my patch (I plan on delivering this tomorrow) ?

Thanks, Roland.

On 02/14/2011 09:22 PM, Dan Carpenter wrote:
>> On 02/12/2011 04:00 PM, Stanislav Fomichev wrote:
>>> This causes an oops when the bcm43xx_hdr-0.fw binary is not found.
>>>
>
> This patch isn't right. It fixes the oops but it introduces some leaks.
> (We still need to release firmware that was allocated successfully).
>
> regards,
> dan carpenter
>



2011-02-18 21:04:14

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH] brcm80211: remove multiple calls to wl_release_fw

On Sat, Feb 12, 2011 at 06:00:33PM +0300, Stanislav Fomichev wrote:
> This causes an oops when the bcm43xx_hdr-0.fw binary is not found.
>
> Signed-off-by: Stanislav Fomichev <[email protected]>
> ---
> drivers/staging/brcm80211/sys/wl_mac80211.c | 2 --

This doesn't apply on linux-next, what tree is it supposed to be for?

confused,

greg k-h

2011-02-14 21:08:01

by Stanislav Fomichev

[permalink] [raw]
Subject: Re: [PATCH] brcm80211: remove multiple calls to wl_release_fw

> This patch isn't right. It fixes the oops but it introduces some leaks.
> (We still need to release firmware that was allocated successfully).
Sorry Dan, but where do you see the leaks? We make a call to
wl_request_fw and if returns non-zero call wl_release_fw for a cleanup.

I just removed the call to wl_release_fw in the wl_request_fw itself; so
it should not introduce any leak.

Could you pls clarify?

--
Stas

2011-02-19 09:03:56

by Stanislav Fomichev

[permalink] [raw]
Subject: Re: [PATCH] brcm80211: remove multiple calls to wl_release_fw

> This doesn't apply on linux-next, what tree is it supposed to be for?
I suppose it was based on the Linus's tree (I didn't know that the
developing is going on on this list).

Anyway, pls drop this patch; the similar fixes should be done in one of
the Roland Vossen's patches.

--
Stas

2011-02-14 21:20:22

by Dan Carpenter

[permalink] [raw]
Subject: Re: [PATCH] brcm80211: remove multiple calls to wl_release_fw

On Tue, Feb 15, 2011 at 12:07:55AM +0300, Stanislav Fomichev wrote:
> > This patch isn't right. It fixes the oops but it introduces some leaks.
> > (We still need to release firmware that was allocated successfully).
> Sorry Dan, but where do you see the leaks? We make a call to
> wl_request_fw and if returns non-zero call wl_release_fw for a cleanup.
>
> I just removed the call to wl_release_fw in the wl_request_fw itself; so
> it should not introduce any leak.
>
> Could you pls clarify?

Ah. Right. I see what you're saying. Your patch looks good to me.

regards,
dan carpenter


2011-02-14 19:59:25

by Roland Vossen

[permalink] [raw]
Subject: Re: [PATCH] brcm80211: remove multiple calls to wl_release_fw

Hi Stanislav,

this patch is ok with me. For future patches, can you post to
[email protected] since that is the main list for the
brcm80211 driver ?

I will align yet unsubmitted patches having to do with firmware handling
with your patch.

Thanks, Roland.

Reviewed-by: Roland Vossen <[email protected]>

On 02/12/2011 04:00 PM, Stanislav Fomichev wrote:
> This causes an oops when the bcm43xx_hdr-0.fw binary is not found.
>
> Signed-off-by: Stanislav Fomichev<[email protected]>
> ---
> drivers/staging/brcm80211/sys/wl_mac80211.c | 2 --
> 1 files changed, 0 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/brcm80211/sys/wl_mac80211.c b/drivers/staging/brcm80211/sys/wl_mac80211.c
> index cd8392b..5faa521 100644
> --- a/drivers/staging/brcm80211/sys/wl_mac80211.c
> +++ b/drivers/staging/brcm80211/sys/wl_mac80211.c
> @@ -1767,7 +1767,6 @@ static int wl_request_fw(struct wl_info *wl, struct pci_dev *pdev)
> if (status) {
> printf("%s: fail to load firmware %s\n",
> KBUILD_MODNAME, fw_name);
> - wl_release_fw(wl);
> return status;
> }
> WL_NONE("request fw %s\n", fw_name);
> @@ -1777,7 +1776,6 @@ static int wl_request_fw(struct wl_info *wl, struct pci_dev *pdev)
> if (status) {
> printf("%s: fail to load firmware %s\n",
> KBUILD_MODNAME, fw_name);
> - wl_release_fw(wl);
> return status;
> }
> wl->fw.hdr_num_entries[i] =



2011-02-14 20:23:08

by Dan Carpenter

[permalink] [raw]
Subject: Re: [PATCH] brcm80211: remove multiple calls to wl_release_fw

> On 02/12/2011 04:00 PM, Stanislav Fomichev wrote:
> >This causes an oops when the bcm43xx_hdr-0.fw binary is not found.
> >

This patch isn't right. It fixes the oops but it introduces some leaks.
(We still need to release firmware that was allocated successfully).

regards,
dan carpenter

2011-02-14 21:03:41

by Stanislav Fomichev

[permalink] [raw]
Subject: Re: [PATCH] brcm80211: remove multiple calls to wl_release_fw

Hi all,

> I already had a patch in the making that is a superset of
> Stanislav's patch. It fixes the leak issue. I agreed with
> Stanislav's patch since, I made the same (but: more) changes.
> Stanislav, can we agree that we wait for my patch (I plan on
> delivering this tomorrow) ?
It's alright with me. I just wanted to point out an error; so I can wait
for a better fix.

--
Stas