[PATCH] lib: fwts_cpu: fix missing { } on an if statement
Colin King
colin.king at canonical.com
Wed Aug 17 10:00:05 UTC 2016
From: Colin Ian King <colin.king at canonical.com>
We're missing { } around two statements following an if statement which
is clearly a bug. Fix this.
Found with static analysis by cppcheck:
[src/lib/src/fwts_cpu.c:256]: (style) Statements following return, break,
continue, goto or throw will never be executed.
Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
src/lib/src/fwts_cpu.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/lib/src/fwts_cpu.c b/src/lib/src/fwts_cpu.c
index c0b1ec2..b28fb59 100644
--- a/src/lib/src/fwts_cpu.c
+++ b/src/lib/src/fwts_cpu.c
@@ -250,9 +250,10 @@ fwts_bool fwts_cpu_has_c1e(void)
}
if (val >= 2) {
- if (fwts_cpu_readmsr(0, MSR_AMD64_OSVW_STATUS, &val) != FWTS_OK)
+ if (fwts_cpu_readmsr(0, MSR_AMD64_OSVW_STATUS, &val) != FWTS_OK) {
rc = FWTS_BOOL_ERROR;
goto free_info;
+ }
if (!(val & 2)) {
rc = FWTS_FALSE;
goto free_info;
--
2.8.1
More information about the fwts-devel
mailing list