staging: rtl8192u: fix a dubious looking mask before a shift
authorColin Ian King <colin.king@canonical.com>
Thu, 16 Jul 2020 15:47:20 +0000 (16:47 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Aug 2020 06:23:55 +0000 (08:23 +0200)
commit18f2b5b48102c512660e51c0237b4dae8ed8a713
tree67cc89c3dd536b16ff87fc8bb6e4277a93dd02d3
parent097ad6fe5795f0933bc4676d8111b8eaf4bc296e
staging: rtl8192u: fix a dubious looking mask before a shift

[ Upstream commit c4283950a9a4d3bf4a3f362e406c80ab14f10714 ]

Currently the masking of ret with 0xff and followed by a right shift
of 8 bits always leaves a zero result.  It appears the mask of 0xff
is incorrect and should be 0xff00, but I don't have the hardware to
test this. Fix this to mask the upper 8 bits before shifting.

[ Not tested ]

Addresses-Coverity: ("Operands don't affect result")
Fixes: 8fc8598e61f6 ("Staging: Added Realtek rtl8192u driver to staging")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20200716154720.1710252-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/staging/rtl8192u/r8192U_core.c