From 0c630d9003a49a812e3f4a0c476f30d8a42a8572 Mon Sep 17 00:00:00 2001 From: Binbin Wu Date: Tue, 21 Aug 2018 22:28:38 +0800 Subject: [PATCH] dm: cmos: fix a logic error for read to clear range Signed-off-by: Binbin Wu Acked-by: Anthony Xu --- devicemodel/hw/platform/cmos_io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devicemodel/hw/platform/cmos_io.c b/devicemodel/hw/platform/cmos_io.c index cbdfeb2e2..231030e02 100644 --- a/devicemodel/hw/platform/cmos_io.c +++ b/devicemodel/hw/platform/cmos_io.c @@ -92,7 +92,7 @@ cmos_io_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes, if (in) { *eax = ctx->cmos_buffer[buf_offset]; /* read to clear for Key range */ - if ((buf_offset >= CMOS_VRPMB_START) || + if ((buf_offset >= CMOS_VRPMB_START) && (buf_offset <= CMOS_VRPMB_END)) ctx->cmos_buffer[buf_offset] = 0; }