Skip to content

Commit 1c689cb

Browse files
segooncmetcalf-tilera
authored andcommitted
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>
1 parent a2262d8 commit 1c689cb

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎arch/tile/kernel/hardwall.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,8 @@ static struct hardwall_info *hardwall_create(
364364
/* Allocate a new rectangle optimistically. */
365365
rect = kmalloc(sizeof(struct hardwall_info),
366366
GFP_KERNEL | __GFP_ZERO);
367+
if (rect == NULL)
368+
return ERR_PTR(-ENOMEM);
367369
INIT_LIST_HEAD(&rect->task_head);
368370

369371
/* Compute the rectangle size and validate that it's plausible. */

0 commit comments

Comments
 (0)