From: Eli Billauer Date: Thu, 4 Sep 2014 14:47:50 +0000 (+0300) Subject: staging: xillybus: Clarified the stop condition for a loop X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1af1ea6b2caeefa9e99e5d8d9c94f34571a168d7;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git 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 --- 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;