drivers/misc/ti-st/st_core.c: missing NULL check

Addresses https://bugzilla.kernel.org/show_bug.cgi?44431

Reported-by: <rucsoftsec@gmail.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Cc: Pavan Savoy <pavan_savoy@ti.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Alan Cox 2012-07-30 14:40:06 -07:00 committed by Linus Torvalds
parent b57b44ae69
commit 5353cf089b
1 changed files with 5 additions and 0 deletions

View File

@ -349,6 +349,11 @@ void st_int_recv(void *disc_data,
st_gdata->rx_skb = alloc_skb(
st_gdata->list[type]->max_frame_size,
GFP_ATOMIC);
if (st_gdata->rx_skb == NULL) {
pr_err("out of memory: dropping\n");
goto done;
}
skb_reserve(st_gdata->rx_skb,
st_gdata->list[type]->reserve);
/* next 2 required for BT only */