diff options
author | Arend van Spriel <arend@broadcom.com> | 2012-09-13 23:12:05 +0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-09-24 22:59:09 +0400 |
commit | 4f6e1cafe25df11f4c8afe5d6a3ee051aa6d5de3 (patch) | |
tree | 1d0a6212f4719d9fa3566935ad6f3cab58222915 /drivers/net/wireless/brcm80211 | |
parent | 9cd23a7191f1abc32252ba92494a910d5cc5fd02 (diff) | |
download | linux-4f6e1cafe25df11f4c8afe5d6a3ee051aa6d5de3.tar.xz |
brcmfmac: add parameter check in brcmf_c_mkiovar()
This patch assures data is only appended in output buffer when
data is not NULL and datalen is not zero.
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/brcm80211')
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c index f6b862d77986..c45270a2a1d9 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c @@ -80,8 +80,10 @@ brcmf_c_mkiovar(char *name, char *data, uint datalen, char *buf, uint buflen) strncpy(buf, name, buflen); /* append data onto the end of the name string */ - memcpy(&buf[len], data, datalen); - len += datalen; + if (data && datalen) { + memcpy(&buf[len], data, datalen); + len += datalen; + } return len; } |