aboutsummaryrefslogtreecommitdiff
path: root/hw/lm832x.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/lm832x.c')
-rw-r--r--hw/lm832x.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/hw/lm832x.c b/hw/lm832x.c
index dd94310f67..6479e1487c 100644
--- a/hw/lm832x.c
+++ b/hw/lm832x.c
@@ -519,8 +519,10 @@ void lm832x_key_event(struct i2c_slave *i2c, int key, int state)
if ((s->status & INT_ERROR) && (s->error & ERR_FIFOOVR))
return;
- if (s->kbd.len >= sizeof(s->kbd.fifo))
- return lm_kbd_error(s, ERR_FIFOOVR);
+ if (s->kbd.len >= sizeof(s->kbd.fifo)) {
+ lm_kbd_error(s, ERR_FIFOOVR);
+ return;
+ }
s->kbd.fifo[(s->kbd.start + s->kbd.len ++) & (sizeof(s->kbd.fifo) - 1)] =
key | (state << 7);