summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/pt-sgi.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/pt-sgi.h b/include/pt-sgi.h
index 15f355b84..547b37a87 100644
--- a/include/pt-sgi.h
+++ b/include/pt-sgi.h
@@ -99,8 +99,10 @@ static inline uint32_t sgi_pt_checksum(struct sgi_disklabel *label)
i = sizeof(*label) / sizeof(*ptr);
- while (i--)
+ while (i) {
+ i--;
sum -= be32_to_cpu(ptr[i]);
+ }
return sum;
}