Commit 6ae9ac0b authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman
Browse files

staging: wilc1000: off by one in get_handler_from_id()



The > should be >= here or we read beyond the end of the array.

Fixes: d42ab083 ('staging: wilc1000: use id value as argument')
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6de9a2e3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -637,7 +637,7 @@ static int get_id_from_handler(tstrWILC_WFIDrv *handler)

static tstrWILC_WFIDrv *get_handler_from_id(int id)
{
	if (id <= 0 || id > ARRAY_SIZE(wfidrv_list))
	if (id <= 0 || id >= ARRAY_SIZE(wfidrv_list))
		return NULL;
	return wfidrv_list[id];
}