diff mbox series

[Bug,report] Probably variable is being overwritten

Message ID 28270724-1c20-5b28-e5cf-ffe29a85ce4c@collabora.com
State New
Headers show
Series [Bug,report] Probably variable is being overwritten | expand

Commit Message

Muhammad Usama Anjum Oct. 4, 2022, 7:52 a.m. UTC
Hi,

A bit in rfb0r1 is being cleared and result is stored in rfval. Then the
first bit is being set without reusing the rfval. It is probably bug or
dead code? The same pattern can be seen repeated below as well.


                        rfval = rfb0r2 | 0x11;
diff mbox series

Patch

diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
index cbbb1a4849cf..4857e3818418 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
@@ -8844,7 +8844,7 @@  static void rt2800_rxiq_calibration(struct
rt2x00_dev *rt2x00dev)
        for (ch_idx = 0; ch_idx < 2; ch_idx = ch_idx + 1) {
                if (ch_idx == 0) {
                        rfval = rfb0r1 & (~0x3);
-                       rfval = rfb0r1 | 0x1;
+                       rfval = rfval | 0x1;
                        rt2800_rfcsr_write_bank(rt2x00dev, 0, 1, rfval);
                        rfval = rfb0r2 & (~0x33);