Commit 12fb1ae5 authored by Ajay Singh's avatar Ajay Singh Committed by Kalle Valo

wifi: wilc1000: get correct length of string WID from received config packet

For string type WID packet, the data length is received as 16-bit value
so use 'get_unaligned_le16' conversion API to extract the correct length.
Signed-off-by: default avatarAjay Singh <ajay.kathat@microchip.com>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220720160302.231516-5-ajay.kathat@microchip.com
parent 33d4a577
......@@ -181,9 +181,10 @@ static void wilc_wlan_parse_response_frame(struct wilc *wl, u8 *info, int size)
i++;
if (cfg->s[i].id == wid)
memcpy(cfg->s[i].str, &info[2], info[2] + 2);
memcpy(cfg->s[i].str, &info[2],
get_unaligned_le16(&info[2]) + 2);
len = 2 + info[2];
len = 2 + get_unaligned_le16(&info[2]);
break;
default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment