diff options
-rw-r--r-- | hw/ppc/spapr_rtc.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/hw/ppc/spapr_rtc.c b/hw/ppc/spapr_rtc.c index e290ac0699..13eeab8745 100644 --- a/hw/ppc/spapr_rtc.c +++ b/hw/ppc/spapr_rtc.c @@ -36,7 +36,7 @@ static void rtas_get_time_of_day(PowerPCCPU *cpu, sPAPREnvironment *spapr, { struct tm tm; - if (nret != 8) { + if ((nargs != 0) || (nret != 8)) { rtas_st(rets, 0, RTAS_OUT_PARAM_ERROR); return; } @@ -60,6 +60,11 @@ static void rtas_set_time_of_day(PowerPCCPU *cpu, sPAPREnvironment *spapr, { struct tm tm; + if ((nargs != 7) || (nret != 1)) { + rtas_st(rets, 0, RTAS_OUT_PARAM_ERROR); + return; + } + tm.tm_year = rtas_ld(args, 0) - 1900; tm.tm_mon = rtas_ld(args, 1) - 1; tm.tm_mday = rtas_ld(args, 2); |