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: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220720160302.231516-5-ajay.kathat@microchip.com
This commit is contained in:
Ajay Singh 2022-07-20 16:03:04 +00:00 committed by Kalle Valo
parent 33d4a577c7
commit 12fb1ae537

View file

@ -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: