[bug report] misc: rtsx: add rts5261 efuse function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Ricky WU,

The patch b1c5f3085149: "misc: rtsx: add rts5261 efuse function" from
Mar 21, 2022, leads to the following Smatch static checker warning:

drivers/misc/cardreader/rts5261.c:412 rts5261_init_from_hw() error: uninitialized symbol 'setting_reg2'.
drivers/misc/cardreader/rts5261.c:430 rts5261_init_from_hw() error: uninitialized symbol 'setting_reg1'.

drivers/misc/cardreader/rts5261.c
    383         rtsx_pci_read_register(pcr, RTS5261_EFUSE_READ_DATA, &tmp);
    384         efuse_valid = ((tmp & 0x0C) >> 2);
    385         pcr_dbg(pcr, "Load efuse valid: 0x%x\n", efuse_valid);
    386 
    387         pci_read_config_dword(pdev, PCR_SETTING_REG2, &lval2);
    388         pcr_dbg(pcr, "Cfg 0x%x: 0x%x\n", PCR_SETTING_REG2, lval2);
    389         /* 0x816 */
    390         valid = (u8)((lval2 >> 16) & 0x03);
    391 
    392         rtsx_pci_write_register(pcr, RTS5261_REG_PME_FORCE_CTL,
    393                 REG_EFUSE_POR, 0);
    394         pcr_dbg(pcr, "Disable efuse por!\n");
    395 
    396         if (efuse_valid == 2 || efuse_valid == 3) {
    397                 if (valid == 3) {
    398                         /* Bypass efuse */
    399                         setting_reg1 = PCR_SETTING_REG1;
    400                         setting_reg2 = PCR_SETTING_REG2;
    401                 } else {
    402                         /* Use efuse data */
    403                         setting_reg1 = PCR_SETTING_REG4;
    404                         setting_reg2 = PCR_SETTING_REG5;
    405                 }
    406         } else if (efuse_valid == 0) {
    407                 // default
    408                 setting_reg1 = PCR_SETTING_REG1;
    409                 setting_reg2 = PCR_SETTING_REG2;
    410         }

What if efuse_valid == 1?

    411 
--> 412         pci_read_config_dword(pdev, setting_reg2, &lval2);
                                            ^^^^^^^^^^^^

    413         pcr_dbg(pcr, "Cfg 0x%x: 0x%x\n", setting_reg2, lval2);
    414 

regards,
dan carpenter



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux