diff options
-rw-r--r-- | drivers/misc/ti-st/st_core.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/misc/ti-st/st_core.c b/drivers/misc/ti-st/st_core.c index c8e335db3451..1f973ce3043f 100644 --- a/drivers/misc/ti-st/st_core.c +++ b/drivers/misc/ti-st/st_core.c | |||
@@ -338,6 +338,12 @@ void st_int_recv(void *disc_data, | |||
338 | /* Unknow packet? */ | 338 | /* Unknow packet? */ |
339 | default: | 339 | default: |
340 | type = *ptr; | 340 | type = *ptr; |
341 | if (st_gdata->list[type] == NULL) { | ||
342 | pr_err("chip/interface misbehavior dropping" | ||
343 | " frame starting with 0x%02x", type); | ||
344 | goto done; | ||
345 | |||
346 | } | ||
341 | st_gdata->rx_skb = alloc_skb( | 347 | st_gdata->rx_skb = alloc_skb( |
342 | st_gdata->list[type]->max_frame_size, | 348 | st_gdata->list[type]->max_frame_size, |
343 | GFP_ATOMIC); | 349 | GFP_ATOMIC); |
@@ -354,6 +360,7 @@ void st_int_recv(void *disc_data, | |||
354 | ptr++; | 360 | ptr++; |
355 | count--; | 361 | count--; |
356 | } | 362 | } |
363 | done: | ||
357 | spin_unlock_irqrestore(&st_gdata->lock, flags); | 364 | spin_unlock_irqrestore(&st_gdata->lock, flags); |
358 | pr_debug("done %s", __func__); | 365 | pr_debug("done %s", __func__); |
359 | return; | 366 | return; |