Skip to content

Commit f8a70d8

Browse files
Dan Carpentergregkh
authored andcommitted
misc: vexpress: Off by one in vexpress_syscfg_exec()
The > comparison should be >= to prevent reading beyond the end of the func->template[] array. (The func->template array is allocated in vexpress_syscfg_regmap_init() and it has func->num_templates elements.) Fixes: 974cc7b ("mfd: vexpress: Define the device as MFD cells") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Sudeep Holla <sudeep.holla@arm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent b505848 commit f8a70d8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/misc/vexpress-syscfg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ static int vexpress_syscfg_exec(struct vexpress_syscfg_func *func,
6161
int tries;
6262
long timeout;
6363

64-
if (WARN_ON(index > func->num_templates))
64+
if (WARN_ON(index >= func->num_templates))
6565
return -EINVAL;
6666

6767
command = readl(syscfg->base + SYS_CFGCTRL);

0 commit comments

Comments
 (0)