You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.4 KiB
47 lines
1.4 KiB
1 month ago
|
From 38f712dba339bb9bd6a73cc7219d217871e7f27a Mon Sep 17 00:00:00 2001
|
||
|
From: Xiao Ni <xni@redhat.com>
|
||
|
Date: Fri, 26 Jul 2024 15:14:15 +0800
|
||
|
Subject: [PATCH 149/157] mdadm/super1: fix coverity issue EVALUATION_ORDER
|
||
|
|
||
|
Fix evaluation order problems in super1.c
|
||
|
|
||
|
Signed-off-by: Xiao Ni <xni@redhat.com>
|
||
|
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
|
||
|
---
|
||
|
super1.c | 7 +++++--
|
||
|
1 file changed, 5 insertions(+), 2 deletions(-)
|
||
|
|
||
|
diff --git a/super1.c b/super1.c
|
||
|
index 24bc1026..243eeb1a 100644
|
||
|
--- a/super1.c
|
||
|
+++ b/super1.c
|
||
|
@@ -340,6 +340,9 @@ static void examine_super1(struct supertype *st, char *homehost)
|
||
|
unsigned long long sb_offset;
|
||
|
struct mdinfo info;
|
||
|
int inconsistent = 0;
|
||
|
+ unsigned int expected_csum = 0;
|
||
|
+
|
||
|
+ expected_csum = calc_sb_1_csum(sb);
|
||
|
|
||
|
printf(" Magic : %08x\n", __le32_to_cpu(sb->magic));
|
||
|
printf(" Version : 1");
|
||
|
@@ -507,13 +510,13 @@ static void examine_super1(struct supertype *st, char *homehost)
|
||
|
printf("\n");
|
||
|
}
|
||
|
|
||
|
- if (calc_sb_1_csum(sb) == sb->sb_csum)
|
||
|
+ if (expected_csum == sb->sb_csum)
|
||
|
printf(" Checksum : %x - correct\n",
|
||
|
__le32_to_cpu(sb->sb_csum));
|
||
|
else
|
||
|
printf(" Checksum : %x - expected %x\n",
|
||
|
__le32_to_cpu(sb->sb_csum),
|
||
|
- __le32_to_cpu(calc_sb_1_csum(sb)));
|
||
|
+ __le32_to_cpu(expected_csum));
|
||
|
printf(" Events : %llu\n",
|
||
|
(unsigned long long)__le64_to_cpu(sb->events));
|
||
|
printf("\n");
|
||
|
--
|
||
|
2.41.0
|
||
|
|