]> git.baikalelectronics.ru Git - kernel.git/commit
mwifiex: debugfs: Fix (sometimes) off-by-1 SSID print
authorBrian Norris <briannorris@chromium.org>
Mon, 9 Jan 2017 23:33:50 +0000 (15:33 -0800)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 17 Jan 2017 12:03:32 +0000 (14:03 +0200)
commitea1f91ff2686cc8be8bb1edf491a7451118c92d9
tree9eefc0b6f3ffe681d21d2e552ed053268e4f9825
parent59f653c46c1a2c51c73561efcffb2d796a4dfa46
mwifiex: debugfs: Fix (sometimes) off-by-1 SSID print

Similar to commit 25809f5751bf ("mwifiex: printk() overflow with 32-byte
SSIDs"), we failed to account for the existence of 32-char SSIDs in our
debugfs code. Unlike in that case though, we zeroed out the containing
struct first, and I'm pretty sure we're guaranteed to have some padding
after the 'ssid.ssid' and 'ssid.ssid_len' fields (the struct is 33 bytes
long).

So, this is the difference between:

  # cat /sys/kernel/debug/mwifiex/mlan0/info
  ...
  essid="0123456789abcdef0123456789abcdef "
  ...

and the correct output:

  # cat /sys/kernel/debug/mwifiex/mlan0/info
  ...
  essid="0123456789abcdef0123456789abcdef"
  ...

Fixes: 0564d842e815 ("wireless: mwifiex: initial commit for Marvell mwifiex driver")
Signed-off-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/marvell/mwifiex/debugfs.c