brcmfmac: rework pointer trickery in brcmf_proto_bcdc_query_dcmd()
authorArend Van Spriel <[email protected]>
Mon, 19 Sep 2016 11:09:52 +0000 (12:09 +0100)
committerKalle Valo <[email protected]>
Mon, 26 Sep 2016 17:35:52 +0000 (20:35 +0300)
The variable info is assigned to point to bcdc->msg[1], which is the
same as pointing to bcdc->buf. As that is what we want to access
make it clear by fixing the assignment. This also avoid out-of-bounds
errors from static analyzers are bcdc->msg[1] is not in the structure
definition.

Reviewed-by: Hante Meuleman <[email protected]>
Reviewed-by: Pieter-Paul Giesberts <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
Signed-off-by: Arend van Spriel <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c

index d1bc51f92686530ee020563f0f6dc604d2afd7cf..038a960c5104fe19dd66838e0a555d29d5f795d0 100644 (file)
@@ -194,7 +194,7 @@ retry:
        }
 
        /* Check info buffer */
-       info = (void *)&msg[1];
+       info = (void *)&bcdc->buf[0];
 
        /* Copy info buffer */
        if (buf) {