Skip to contentSkip to conversation

wm8750: Fix calculation of number of array elements

PATCH Applied Stefan Weil 2 participants 2 messages Jan 9, 2012 – Jan 10, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wm8750: Fix calculation of number of array elements

Coverity says that the division by sizeof(*s->rate) might be wrong. I think that coverity is right.

Cc Andrzej Zaborowski <[email protected]>
---
 hw/wm8750.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
hw/wm8750.c +1 -1
index 39383f4..b3589d3 100644
@@ -563,7 +563,7 @@ static void wm8750_pre_save(void *opaque)
 {
     WM8750State *s = opaque;
 
-    s->rate_vmstate = (s->rate - wm_rate_table) / sizeof(*s->rate);
+    s->rate_vmstate = s->rate - wm_rate_table;
 }
 
 static int wm8750_post_load(void *opaque, int version_id)
Signature · 1 line
1.7.2.5
#1 lore raw
Quoted 2 lines · Stefan Weil

Coverity says that the division by sizeof(*s->rate) might be wrong. I think that coverity is right.

Thanks, applied.

Cheers