Skip to contentSkip to conversation

Patch "staging/rts5208: fix incorrect shift to extract upper nybble" has been added to the 4.13-stable tree

PATCH [email protected] 1 participant 1 message Sep 7, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

staging/rts5208: fix incorrect shift to extract upper nybble

to the 4.13-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
staging-rts5208-fix-incorrect-shift-to-extract-upper-nybble.patch
and it can be found in the queue-4.13 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 34ff1bf4920471cff66775dc39537b15c5f0feff Mon Sep 17 00:00:00 2001

From: Colin Ian King <[email protected]>
Date: Fri, 18 Aug 2017 14:34:16 +0100
Subject: staging/rts5208: fix incorrect shift to extract upper nybble

From: Colin Ian King <[email protected]>

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")
---
 drivers/staging/rts5208/rtsx_scsi.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rts5208/rtsx_scsi.c +1 -1
@@ -414,7 +414,7 @@ void set_sense_data(struct rtsx_chip *ch
 	sense->ascq = ascq;
 	if (sns_key_info0 != 0) {
 		sense->sns_key_info[0] = SKSV | sns_key_info0;
-		sense->sns_key_info[1] = (sns_key_info1 & 0xf0) >> 8;
+		sense->sns_key_info[1] = (sns_key_info1 & 0xf0) >> 4;
 		sense->sns_key_info[2] = sns_key_info1 & 0x0f;
 	}
 }

Patches currently in stable-queue which might be from [email protected] are

queue-4.13/staging-rts5208-fix-incorrect-shift-to-extract-upper-nybble.patch queue-4.13/thunderbolt-fix-reset-response_type.patch