brcmfmac: check memory allocation in brcmf_add_if()
[deliverable/linux.git] / drivers / net / wireless / brcm80211 / brcmfmac / dhd_linux.c
index 763a84eba2164ca73a07923059f39c067a8717da..269fde2a8168aa9b766f9d93d32e1b04ed8b69c6 100644 (file)
@@ -754,6 +754,8 @@ struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, s32 bssidx, s32 ifidx,
                /* this is P2P_DEVICE interface */
                brcmf_dbg(INFO, "allocate non-netdev interface\n");
                ifp = kzalloc(sizeof(*ifp), GFP_KERNEL);
+               if (!ifp)
+                       return ERR_PTR(-ENOMEM);
        } else {
                brcmf_dbg(INFO, "allocate netdev interface\n");
                /* Allocate netdev, including space for private structure */
This page took 0.025901 seconds and 5 git commands to generate.