All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: rtl8192u: fix incorrect mask for EEPROMTxPowerLevelCCK setting
@ 2019-03-29  0:02 Colin King
  2019-03-29  8:24   ` Dan Carpenter
  0 siblings, 1 reply; 3+ messages in thread
From: Colin King @ 2019-03-29  0:02 UTC (permalink / raw)
  To: Greg Kroah-Hartman, John Whitmore, devel; +Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Currently the lower 8 bits of ret are being masked and left
shifted by 8 bits always leaving a result of zero. The mask
appears to be incorrect and should probably be 0xff00 instead
of 0xff.  Fix this.  (Note: not tested).

Fixes: 16feab644fd1 ("staging: rtl8192u: check return value eprom_read")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/staging/rtl8192u/r8192U_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c
index f1eaab337dca..a173884d31c8 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -2454,7 +2454,7 @@ static int rtl8192_read_eeprom_info(struct net_device *dev)
 				ret = eprom_read(dev, (EEPROM_TX_PW_INDEX_CCK >> 1));
 				if (ret < 0)
 					return ret;
-				priv->EEPROMTxPowerLevelCCK = ((u16)ret & 0xff) >> 8;
+				priv->EEPROMTxPowerLevelCCK = ((u16)ret & 0xff00) >> 8;
 			} else
 				priv->EEPROMTxPowerLevelCCK = 0x10;
 			RT_TRACE(COMP_EPROM, "CCK Tx Power Levl: 0x%02x\n", priv->EEPROMTxPowerLevelCCK);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-03-29  8:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-29  0:02 [PATCH] staging: rtl8192u: fix incorrect mask for EEPROMTxPowerLevelCCK setting Colin King
2019-03-29  8:24 ` Dan Carpenter
2019-03-29  8:24   ` Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.