Skip to content

Commit

Permalink
brcm80211: fix missing allocation failure check
Browse files Browse the repository at this point in the history
Check for oobirq_entry allocation failure to avoid
NULL pointer dereferencing.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Colin Ian King authored and John W. Linville committed Sep 10, 2012
1 parent 74673db commit 4abd044
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,8 @@ static int brcmf_sdio_pd_probe(struct platform_device *pdev)

oobirq_entry = kzalloc(sizeof(struct brcmf_sdio_oobirq),
GFP_KERNEL);
if (!oobirq_entry)
return -ENOMEM;
oobirq_entry->irq = res->start;
oobirq_entry->flags = res->flags & IRQF_TRIGGER_MASK;
list_add_tail(&oobirq_entry->list, &oobirq_lh);
Expand Down

0 comments on commit 4abd044

Please sign in to comment.