diff mbox

brcmfmac: clear sdiodev->pdata if irq_of_parse_and_map fails

Message ID 20150520140206.GA11272@linux.se.axis.com (mailing list archive)
State Rejected
Delegated to: Kalle Valo
Headers show

Commit Message

Henrik Eriksson May 20, 2015, 2:02 p.m. UTC
Clear the pdata pointer in sdiodev after freeing the memory.  In my case
not doing so interferes with device initialization as request_irq of
sdiodev->pdata->oob_irq_nr fails, but even if not, leaving a wild
pointer is incorrect.

Signed-off-by: Henrik Eriksson <henriken@axis.com>
---
 drivers/net/wireless/brcm80211/brcmfmac/of.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Henrik Eriksson May 20, 2015, 2:57 p.m. UTC | #1
Please ignore this.  [PATCH 1/6] brcmfmac: allow device tree node
without 'interrupts' property posted earlier today deals with the same
thing, in a better way.

On Wed, May 20, 2015 at 16:02:15 +0200, Henrik Eriksson wrote:
> Clear the pdata pointer in sdiodev after freeing the memory.  In my case
> not doing so interferes with device initialization as request_irq of
> sdiodev->pdata->oob_irq_nr fails, but even if not, leaving a wild
> pointer is incorrect.
> 
> Signed-off-by: Henrik Eriksson <henriken@axis.com>
> ---
>  drivers/net/wireless/brcm80211/brcmfmac/of.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/wireless/brcm80211/brcmfmac/of.c b/drivers/net/wireless/brcm80211/brcmfmac/of.c
> index c824570..71ead7b 100644
> --- a/drivers/net/wireless/brcm80211/brcmfmac/of.c
> +++ b/drivers/net/wireless/brcm80211/brcmfmac/of.c
> @@ -43,6 +43,7 @@ void brcmf_of_probe(struct brcmf_sdio_dev *sdiodev)
>  	if (!irq) {
>  		brcmf_err("interrupt could not be mapped\n");
>  		devm_kfree(dev, sdiodev->pdata);
> +		sdiodev->pdata = NULL;
>  		return;
>  	}
>  	irqf = irqd_get_trigger_type(irq_get_irq_data(irq));
diff mbox

Patch

diff --git a/drivers/net/wireless/brcm80211/brcmfmac/of.c b/drivers/net/wireless/brcm80211/brcmfmac/of.c
index c824570..71ead7b 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/of.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/of.c
@@ -43,6 +43,7 @@  void brcmf_of_probe(struct brcmf_sdio_dev *sdiodev)
 	if (!irq) {
 		brcmf_err("interrupt could not be mapped\n");
 		devm_kfree(dev, sdiodev->pdata);
+		sdiodev->pdata = NULL;
 		return;
 	}
 	irqf = irqd_get_trigger_type(irq_get_irq_data(irq));