Browse Source

brcm80211: fix missing allocation failure check

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>
Colin Ian King 12 years ago
parent
commit
4abd044af9
1 changed files with 2 additions and 0 deletions
  1. 2 0
      drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c

+ 2 - 0
drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c

@@ -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);