[bug report] fsi: scom: Remove retries

Dan Carpenter dan.carpenter at oracle.com
Thu Nov 25 21:45:04 AEDT 2021


Hello Joel Stanley,

The patch f72ddbe1d7b7: "fsi: scom: Remove retries" from May 27,
2021, leads to the following Smatch static checker warning:

	drivers/fsi/fsi-scom.c:314 get_scom()
	error: uninitialized symbol 'status'.

drivers/fsi/fsi-scom.c
    304 static int get_scom(struct scom_device *scom, uint64_t *value,
    305                     uint64_t addr)
    306 {
    307         uint32_t status;
    308         int rc;
    309 
    310         rc = raw_get_scom(scom, value, addr, &status);
    311         if (rc == -ENODEV)
                    ^^^^^^^^^^^^^
In the original code this called raw_get_scom() until it succeeded, or
if it timed out then get_scom() returned an error.  Now we just ignore
errors except -ENODEV.

    312                 return rc;
    313 
--> 314         rc = handle_fsi2pib_status(scom, status);
                                                 ^^^^^^
Which means that "status" can be uninitialized.

    315         if (rc)
    316                 return rc;
    317 
    318         return handle_pib_status(scom,
    319                                  (status & SCOM_STATUS_PIB_RESP_MASK)
    320                                  >> SCOM_STATUS_PIB_RESP_SHIFT);
    321 }

regards,
dan carpenter


More information about the linux-fsi mailing list