351-0040-brcmfmac-rework-pointer-trickery-in-brcmf_proto_bcdc.patch 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. From 704d1c6b56f4ee2ad6a5f012a72a278d17c1a223 Mon Sep 17 00:00:00 2001
  2. From: Arend Van Spriel <arend.vanspriel@broadcom.com>
  3. Date: Mon, 19 Sep 2016 12:09:52 +0100
  4. Subject: [PATCH] brcmfmac: rework pointer trickery in
  5. brcmf_proto_bcdc_query_dcmd()
  6. The variable info is assigned to point to bcdc->msg[1], which is the
  7. same as pointing to bcdc->buf. As that is what we want to access
  8. make it clear by fixing the assignment. This also avoid out-of-bounds
  9. errors from static analyzers are bcdc->msg[1] is not in the structure
  10. definition.
  11. Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
  12. Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
  13. Reviewed-by: Franky Lin <franky.lin@broadcom.com>
  14. Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
  15. Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  16. ---
  17. drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c | 2 +-
  18. 1 file changed, 1 insertion(+), 1 deletion(-)
  19. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c
  20. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c
  21. @@ -194,7 +194,7 @@ retry:
  22. }
  23. /* Check info buffer */
  24. - info = (void *)&msg[1];
  25. + info = (void *)&bcdc->buf[0];
  26. /* Copy info buffer */
  27. if (buf) {