Skip to content

Commit 8b26055

Browse files
Colin Ian Kinggregkh
authored andcommitted
staging: rtl8192u: fix a dubious looking mask before a shift
[ Upstream commit c428395 ] 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: 8fc8598 ("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>
1 parent 7573ee6 commit 8b26055

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/staging/rtl8192u/r8192U_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2484,7 +2484,7 @@ static int rtl8192_read_eeprom_info(struct net_device *dev)
24842484
ret = eprom_read(dev, (EEPROM_TxPwIndex_CCK >> 1));
24852485
if (ret < 0)
24862486
return ret;
2487-
priv->EEPROMTxPowerLevelCCK = ((u16)ret & 0xff) >> 8;
2487+
priv->EEPROMTxPowerLevelCCK = ((u16)ret & 0xff00) >> 8;
24882488
} else
24892489
priv->EEPROMTxPowerLevelCCK = 0x10;
24902490
RT_TRACE(COMP_EPROM, "CCK Tx Power Levl: 0x%02x\n", priv->EEPROMTxPowerLevelCCK);

0 commit comments

Comments
 (0)