misc: vexpress: Off by one in vexpress_syscfg_exec()
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 3 Dec 2018 14:52:19 +0000 (17:52 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Feb 2019 07:10:11 +0000 (08:10 +0100)
commitdb5f65bfc1fab1de6044cd0fc30bb0aa68ed6373
tree6748f39750ea4a2a8b34dc848af9d22864caab4c
parent959e46afeca14b45a8d91006cf8dd59bb015493e
misc: vexpress: Off by one in vexpress_syscfg_exec()

commit f8a70d8b889f180e6860cb1f85fed43d37844c5a upstream.

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: 974cc7b93441 ("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>
drivers/misc/vexpress-syscfg.c