Skip to content

Commit 3fafdd7

Browse files
author
David Vrabel
committed
uwb: handle radio controller events with out-of-range IDs correctly
If a radio controller event has an ID that's just out of range don't read beyond the end of uwbd's event arrays. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: David Vrabel <david.vrabel@csr.com>
1 parent 7c0a57d commit 3fafdd7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎drivers/uwb/uwbd.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,12 +187,12 @@ int uwbd_event_handle_urc(struct uwb_event *evt)
187187
event = le16_to_cpu(evt->notif.rceb->wEvent);
188188
context = evt->notif.rceb->bEventContext;
189189

190-
if (type > ARRAY_SIZE(uwbd_urc_evt_type_handlers))
190+
if (type >= ARRAY_SIZE(uwbd_urc_evt_type_handlers))
191191
goto out;
192192
type_table = &uwbd_urc_evt_type_handlers[type];
193193
if (type_table->uwbd_events == NULL)
194194
goto out;
195-
if (event > type_table->size)
195+
if (event >= type_table->size)
196196
goto out;
197197
handler = type_table->uwbd_events[event].handler;
198198
if (handler == NULL)

0 commit comments

Comments
 (0)