Skip to content

hw/timer/renesas_tmr: Fix use of uninitialized data

Peter Maydell qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2hw/timer/renesas_tmr: Prefix constants for CSS values with CSS_hw/timer/renesas_tmr.c+8 -81 reply
2/2hw/timer/renesas_tmr: Fix use of uninitialized data in read_tcnt()hw/timer/renesas_tmr.c+15 -41 reply

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchPhilippe Mathieu-Daudé
1/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] hw/timer/renesas_tmr: Fix use of uninitialized data

This patchseries fixes a use-of-uninitialized-data spotted by Coverity (CID 1429976).

Patch 1 just tweaks some constant names for values of the TCCR.CSS register field, since patch 2 needs to add some more defines for the other possible values of the field.

Patch 2 is the bugfix proper; the use-uninitialized happens if the guest programs TCCR.CSS to values which are either prohibited in the h/w datasheet, or valid but corresponding to behaviour not currently implemented by QEMU. (Yes, I could have added LOG_UNIMP and/or LOG_GUEST_ERROR when the TCCR is written by the guest; it didn't really seem worth the effort to me.)

thanks
-- PMM

Peter Maydell (2):
hw/timer/renesas_tmr: Prefix constants for CSS values with CSS_ hw/timer/renesas_tmr: Fix use of uninitialized data in read_tcnt()

 hw/timer/renesas_tmr.c | 33 ++++++++++++++++++++++-----------
 1 file changed, 22 insertions(+), 11 deletions(-)
Signature · 1 line
2.20.1