Commit 1c689cbcf2c2b7a35cd237abddd9206bb1b6fee1
Committed by
Chris Metcalf
1 parent
a2262d8a23
Exists in
master
and in
7 other branches
arch/tile: check kmalloc() result
If kmalloc() fails exit with -ENOMEM. Signed-off-by: Kulikov Vasiliy <segooon@gmail.com> Acked-by: Chris Metcalf <cmetcalf@tilera.com>
Showing 1 changed file with 2 additions and 0 deletions Side-by-side Diff
arch/tile/kernel/hardwall.c
... | ... | @@ -364,6 +364,8 @@ |
364 | 364 | /* Allocate a new rectangle optimistically. */ |
365 | 365 | rect = kmalloc(sizeof(struct hardwall_info), |
366 | 366 | GFP_KERNEL | __GFP_ZERO); |
367 | + if (rect == NULL) | |
368 | + return ERR_PTR(-ENOMEM); | |
367 | 369 | INIT_LIST_HEAD(&rect->task_head); |
368 | 370 | |
369 | 371 | /* Compute the rectangle size and validate that it's plausible. */ |