]> www.infradead.org Git - users/dwmw2/linux.git/commit
staging/rts5208: fix incorrect shift to extract upper nybble
authorColin Ian King <colin.king@canonical.com>
Fri, 18 Aug 2017 13:34:16 +0000 (14:34 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 9 Sep 2017 15:39:19 +0000 (17:39 +0200)
commita55273d7af6c0e206d166c33870c95e768e6278c
treead68e642a4f3e0d52ca04c865df5383bc208dd64
parent9bf1256726f677a4b3e26112a8e8e2774252e36e
staging/rts5208: fix incorrect shift to extract upper nybble

commit 34ff1bf4920471cff66775dc39537b15c5f0feff upstream.

The mask of sns_key_info1 suggests the upper nybble is being extracted
however the following shift of 8 bits is too large and always results in
0.  Fix this by shifting only by 4 bits to correctly get the upper nybble.

Detected by CoverityScan, CID#142891 ("Operands don't affect result")

Fixes: fa590c222fba ("staging: rts5208: add support for rts5208 and rts5288")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rts5208/rtsx_scsi.c