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

Peter Maydell posted 2 patches 3 years, 2 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20210219223241.16344-1-peter.maydell@linaro.org
Maintainers: Magnus Damm <magnus.damm@gmail.com>, Yoshinori Sato <ysato@users.sourceforge.jp>
hw/timer/renesas_tmr.c | 33 ++++++++++++++++++++++-----------
1 file changed, 22 insertions(+), 11 deletions(-)
[PATCH 0/2] hw/timer/renesas_tmr: Fix use of uninitialized data
Posted by Peter Maydell 3 years, 2 months ago
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(-)

-- 
2.20.1