wifi: airo: do not assign -1 to unsigned char
authorJason A. Donenfeld <Jason@zx2c4.com>
Mon, 24 Oct 2022 16:28:43 +0000 (18:28 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Dec 2022 16:41:01 +0000 (17:41 +0100)
commit86f90014e767806c81fcb3eaf451ae2865601988
treeff8969b9b6e5f1837961f56fb763654fd04e6791
parentf5558fbda022b5898ff64ddd834709d2e433e8a1
wifi: airo: do not assign -1 to unsigned char

[ Upstream commit e6cb8769452e8236b52134e5cb4a18b8f5986932 ]

With char becoming unsigned by default, and with `char` alone being
ambiguous and based on architecture, we get a warning when assigning the
unchecked output of hex_to_bin() to that unsigned char. Mark `key` as a
`u8`, which matches the struct's type, and then check each call to
hex_to_bin() before casting.

Cc: Kalle Valo <kvalo@kernel.org>
Cc: linux-wireless@vger.kernel.org
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20221024162843.535921-1-Jason@zx2c4.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/cisco/airo.c