Skip to content

Commit 5353cf0

Browse files
Alan Coxtorvalds
authored andcommitted
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>
1 parent b57b44a commit 5353cf0

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎drivers/misc/ti-st/st_core.c‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,11 @@ void st_int_recv(void *disc_data,
349349
st_gdata->rx_skb = alloc_skb(
350350
st_gdata->list[type]->max_frame_size,
351351
GFP_ATOMIC);
352+
if (st_gdata->rx_skb == NULL) {
353+
pr_err("out of memory: dropping\n");
354+
goto done;
355+
}
356+
352357
skb_reserve(st_gdata->rx_skb,
353358
st_gdata->list[type]->reserve);
354359
/* next 2 required for BT only */

0 commit comments

Comments
 (0)