diff options
author | Ye Li <ye.li@nxp.com> | 2020-08-03 03:06:22 -0700 |
---|---|---|
committer | Ye Li <ye.li@nxp.com> | 2020-08-04 03:17:17 -0700 |
commit | e395035a52962a84e132b6767871c1b8205ea026 (patch) | |
tree | 55576fefe370644c5cf5c5c3185b696eeca86bf4 /arch | |
parent | 77688f76aacdce26369ff3690ae70460146dedab (diff) |
LF-1876 imx8: snvs_security: Fix dead code in apply_snvs_dgo_config
Fix Coverity Issue 10045175. In apply_snvs_dgo_config, code can never
be reached because of a logical contradiction. So assign the sciErr
to dgo_write return.
Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-imx/imx8/snvs_security_sc.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/arch/arm/mach-imx/imx8/snvs_security_sc.c b/arch/arm/mach-imx/imx8/snvs_security_sc.c index 01ad43750c..10c4772a3d 100644 --- a/arch/arm/mach-imx/imx8/snvs_security_sc.c +++ b/arch/arm/mach-imx/imx8/snvs_security_sc.c @@ -229,9 +229,9 @@ exit: return (sciErr == SC_ERR_NONE) ? 0 : -EIO; } -static sc_err_t dgo_write(u32 _id, u8 _access, u32 *_pdata) +static int dgo_write(u32 _id, u8 _access, u32 *_pdata) { - sc_err_t sciErr = sc_seco_secvio_dgo_config(-1, _id, _access, _pdata); + int sciErr = sc_seco_secvio_dgo_config(-1, _id, _access, _pdata); if (sciErr != SC_ERR_NONE) { printf("Failed to set dgo configuration\n"); @@ -243,7 +243,7 @@ static sc_err_t dgo_write(u32 _id, u8 _access, u32 *_pdata) static int apply_snvs_dgo_config(struct snvs_dgo_conf *cnf) { - sc_err_t sciErr = 0; + int sciErr = 0; debug("%s\n", __func__); @@ -261,28 +261,28 @@ static int apply_snvs_dgo_config(struct snvs_dgo_conf *cnf) cnf->tamper_misc_ctl, cnf->tamper_core_volt_mon_ctl); - dgo_write(0x04, 1, &cnf->tamper_offset_ctl); + sciErr = dgo_write(0x04, 1, &cnf->tamper_offset_ctl); if (sciErr != SC_ERR_NONE) goto exit; - dgo_write(0x14, 1, &cnf->tamper_pull_ctl); + sciErr = dgo_write(0x14, 1, &cnf->tamper_pull_ctl); if (sciErr != SC_ERR_NONE) goto exit; - dgo_write(0x24, 1, &cnf->tamper_ana_test_ctl); + sciErr = dgo_write(0x24, 1, &cnf->tamper_ana_test_ctl); if (sciErr != SC_ERR_NONE) goto exit; - dgo_write(0x34, 1, &cnf->tamper_sensor_trim_ctl); + sciErr = dgo_write(0x34, 1, &cnf->tamper_sensor_trim_ctl); if (sciErr != SC_ERR_NONE) goto exit; - dgo_write(0x54, 1, &cnf->tamper_core_volt_mon_ctl); + sciErr = dgo_write(0x54, 1, &cnf->tamper_core_volt_mon_ctl); if (sciErr != SC_ERR_NONE) goto exit; /* Last as it could lock the writes */ - dgo_write(0x44, 1, &cnf->tamper_misc_ctl); + sciErr = dgo_write(0x44, 1, &cnf->tamper_misc_ctl); if (sciErr != SC_ERR_NONE) goto exit; |