mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-30 15:50:10 -04:00
mwifiex: debugfs: Fix (sometimes) off-by-1 SSID print
Similar to commitfcd2042e8d("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:5e6e3a92b9("wireless: mwifiex: initial commit for Marvell mwifiex driver") Signed-off-by: Brian Norris <briannorris@chromium.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
@@ -114,7 +114,8 @@ mwifiex_info_read(struct file *file, char __user *ubuf,
|
||||
if (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_STA) {
|
||||
p += sprintf(p, "multicast_count=\"%d\"\n",
|
||||
netdev_mc_count(netdev));
|
||||
p += sprintf(p, "essid=\"%s\"\n", info.ssid.ssid);
|
||||
p += sprintf(p, "essid=\"%.*s\"\n", info.ssid.ssid_len,
|
||||
info.ssid.ssid);
|
||||
p += sprintf(p, "bssid=\"%pM\"\n", info.bssid);
|
||||
p += sprintf(p, "channel=\"%d\"\n", (int) info.bss_chan);
|
||||
p += sprintf(p, "country_code = \"%s\"\n", info.country_code);
|
||||
|
||||
Reference in New Issue
Block a user