From 1af1ea6b2caeefa9e99e5d8d9c94f34571a168d7 Mon Sep 17 00:00:00 2001 From: Eli Billauer Date: Thu, 4 Sep 2014 17:47:50 +0300 Subject: [PATCH] staging: xillybus: Clarified the stop condition for a loop Suggested-by: Dan Carpenter Signed-off-by: Eli Billauer Reviewed-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman --- drivers/staging/xillybus/xillybus_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/xillybus/xillybus_core.c b/drivers/staging/xillybus/xillybus_core.c index 63c2c14f876e..1b63197843b7 100644 --- a/drivers/staging/xillybus/xillybus_core.c +++ b/drivers/staging/xillybus/xillybus_core.c @@ -172,9 +172,9 @@ irqreturn_t xillybus_isr(int irq, void *data) return IRQ_HANDLED; } - buf_size = i; + buf_size = i + 2; - for (i = 0; i <= buf_size; i += 2) { /* Scan through messages */ + for (i = 0; i < buf_size; i += 2) { /* Scan through messages */ opcode = (buf[i] >> 24) & 0xff; msg_dir = buf[i] & 1; -- 2.39.5