324-brcmfmac-treat-NULL-character-in-NVRAM-as-separator.patch 1.3 KB

1234567891011121314151617181920212223242526272829303132
  1. From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
  2. Date: Sun, 31 Jan 2016 12:14:34 +0100
  3. Subject: [PATCH] brcmfmac: treat NULL character in NVRAM as separator
  4. MIME-Version: 1.0
  5. Content-Type: text/plain; charset=UTF-8
  6. Content-Transfer-Encoding: 8bit
  7. Platform NVRAM (stored on a flash partition) has entries separated by a
  8. NULL (\0) char. Our parsing code switches from VALUE state to IDLE
  9. whenever it meets a NULL (\0). When that happens our IDLE handler should
  10. simply consume it and analyze whatever is placed ahead.
  11. This fixes harmless warnings spamming debugging output:
  12. [ 155.165624] brcmfmac: brcmf_nvram_handle_idle warning: ln=1:col=20: ignoring invalid character
  13. [ 155.180806] brcmfmac: brcmf_nvram_handle_idle warning: ln=1:col=44: ignoring invalid character
  14. [ 155.195971] brcmfmac: brcmf_nvram_handle_idle warning: ln=1:col=63: ignoring invalid character
  15. Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
  16. Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  17. ---
  18. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
  19. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
  20. @@ -93,7 +93,7 @@ static enum nvram_parser_state brcmf_nvr
  21. c = nvp->data[nvp->pos];
  22. if (c == '\n')
  23. return COMMENT;
  24. - if (is_whitespace(c))
  25. + if (is_whitespace(c) || c == '\0')
  26. goto proceed;
  27. if (c == '#')
  28. return COMMENT;