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

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
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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: