summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorArend van Spriel <arend@broadcom.com>2011-02-10 11:03:45 (GMT)
committerGreg Kroah-Hartman <gregkh@suse.de>2011-02-18 20:48:03 (GMT)
commit8746e2baaedd45b51ceb0adbcaf2ce52bbb83598 (patch)
treeb327ede62171fe0a10036ed4cb2903e13bfd9a65 /drivers
parent0bef7748e1327f72b006ea699e8725be50685f0e (diff)
downloadlinux-fsl-qoriq-8746e2baaedd45b51ceb0adbcaf2ce52bbb83598.tar.xz
staging: brcm80211: fix potential null pointer access handling ucode buffer
Allocation of buffer in function wl_ucode_init_buf can fail. This was signalled by an error message, but code continued to access the null pointer. This is now avoided by jumping to failure label. Reviewed-by: Roland Vossen <rvossen@broadcom.com> Reviewed-by: Brett Rudley <brudley@broadcom.com> Reviewed-by: Henry Ptasinski <henryp@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/brcm80211/brcmsmac/wl_mac80211.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/brcm80211/brcmsmac/wl_mac80211.c b/drivers/staging/brcm80211/brcmsmac/wl_mac80211.c
index c1d6699..304ae68 100644
--- a/drivers/staging/brcm80211/brcmsmac/wl_mac80211.c
+++ b/drivers/staging/brcm80211/brcmsmac/wl_mac80211.c
@@ -1707,6 +1707,7 @@ int wl_ucode_init_buf(struct wl_info *wl, void **pbuf, u32 idx)
if (*pbuf == NULL) {
WL_ERROR("fail to alloc %d bytes\n",
hdr->len);
+ goto fail;
}
bcopy(pdata, *pbuf, hdr->len);
return 0;
@@ -1715,6 +1716,7 @@ int wl_ucode_init_buf(struct wl_info *wl, void **pbuf, u32 idx)
}
WL_ERROR("ERROR: ucode buf tag:%d can not be found!\n", idx);
*pbuf = NULL;
+fail:
return -1;
}