Commit 5353cf089bb32b69a7515be909c14bf05fe2e81e

Authored by Alan Cox
Committed by Linus Torvalds
1 parent b57b44ae69

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>

Showing 1 changed file with 5 additions and 0 deletions Side-by-side Diff

drivers/misc/ti-st/st_core.c
... ... @@ -349,6 +349,11 @@
349 349 st_gdata->rx_skb = alloc_skb(
350 350 st_gdata->list[type]->max_frame_size,
351 351 GFP_ATOMIC);
  352 + if (st_gdata->rx_skb == NULL) {
  353 + pr_err("out of memory: dropping\n");
  354 + goto done;
  355 + }
  356 +
352 357 skb_reserve(st_gdata->rx_skb,
353 358 st_gdata->list[type]->reserve);
354 359 /* next 2 required for BT only */