aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/uwb
diff options
context:
space:
mode:
authorDavid Vrabel <david.vrabel@csr.com>2009-08-25 10:03:07 -0400
committerDavid Vrabel <david.vrabel@csr.com>2009-08-25 10:03:07 -0400
commit3fafdd7cc810a8fcd28b83fbde2d0e25830dee41 (patch)
treead01860283a1ac1a05759a39834fa0b56683f4aa /drivers/uwb
parent7c0a57d5c47bcfc492b3139e77400f888a935c44 (diff)
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>
Diffstat (limited to 'drivers/uwb')
-rw-r--r--drivers/uwb/uwbd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/uwb/uwbd.c b/drivers/uwb/uwbd.c
index 57bd6bfef37e..5a777d8624da 100644
--- a/drivers/uwb/uwbd.c
+++ b/drivers/uwb/uwbd.c
@@ -187,12 +187,12 @@ int uwbd_event_handle_urc(struct uwb_event *evt)
187 event = le16_to_cpu(evt->notif.rceb->wEvent); 187 event = le16_to_cpu(evt->notif.rceb->wEvent);
188 context = evt->notif.rceb->bEventContext; 188 context = evt->notif.rceb->bEventContext;
189 189
190 if (type > ARRAY_SIZE(uwbd_urc_evt_type_handlers)) 190 if (type >= ARRAY_SIZE(uwbd_urc_evt_type_handlers))
191 goto out; 191 goto out;
192 type_table = &uwbd_urc_evt_type_handlers[type]; 192 type_table = &uwbd_urc_evt_type_handlers[type];
193 if (type_table->uwbd_events == NULL) 193 if (type_table->uwbd_events == NULL)
194 goto out; 194 goto out;
195 if (event > type_table->size) 195 if (event >= type_table->size)
196 goto out; 196 goto out;
197 handler = type_table->uwbd_events[event].handler; 197 handler = type_table->uwbd_events[event].handler;
198 if (handler == NULL) 198 if (handler == NULL)