From: Arend van Spriel Date: Wed, 17 Apr 2013 19:25:50 +0000 (+0200) Subject: brcmfmac: check memory allocation in brcmf_add_if() X-Git-Tag: omap-for-v3.10/dt-fixes-for-merge-window~65^2~43^2^2~40 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=991c209393bc30ccb36e212167bf3ecb5f33ff07;p=pandora-kernel.git brcmfmac: check memory allocation in brcmf_add_if() For P2P_DEVICE interface the struct brcmf_if instance is allocated using kzalloc() which can fail. Add pointer check and return -ENOMEM if it failed. Fixes the following smatch error: "drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c:770 brcmf_add_if() error: potential null dereference 'ifp'. (kzalloc returns null)" Reported-by: Dan Carpenter Reported-by: Fengguang Wu Reviewed-by: Hante Meuleman Reviewed-by: Piotr Haber Signed-off-by: Arend van Spriel Signed-off-by: John W. Linville --- Reading git-diff-tree failed