diff options
author | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-06-11 17:10:51 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-06-11 17:10:51 +1000 |
commit | 874b4399c23f09985324826f867ac5d22062b2f5 (patch) | |
tree | b2f118786dab0a7c943bf57b88da67241a4e9917 /hw/xscom.c | |
parent | e0ab4a2dae4028eaeb9a188c901704f40dc6e872 (diff) | |
download | skiboot-874b4399c23f09985324826f867ac5d22062b2f5.zip skiboot-874b4399c23f09985324826f867ac5d22062b2f5.tar.gz skiboot-874b4399c23f09985324826f867ac5d22062b2f5.tar.bz2 |
Fix possible return garbage from xscom_read_cfam_chipid()
If we get an error from the xscom_read() call we could extract a
garbage chip_id rather than just returning an error.
Caught by LLVM scan-build
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw/xscom.c')
-rw-r--r-- | hw/xscom.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -433,7 +433,8 @@ int64_t xscom_read_cfam_chipid(uint32_t partid, uint32_t *chip_id) rc = xscom_read(partid, 0xf000f, &val); /* Extract CFAM id */ - *chip_id = (uint32_t)(val >> 44); + if (rc == OPAL_SUCCESS) + *chip_id = (uint32_t)(val >> 44); return rc; } |