Skip to content

Commit

Permalink
arch/tile: check kmalloc() result
Browse files Browse the repository at this point in the history
If kmalloc() fails exit with -ENOMEM.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Acked-by: Chris Metcalf <cmetcalf@tilera.com>
  • Loading branch information
Kulikov Vasiliy authored and Chris Metcalf committed Jul 16, 2010
1 parent a2262d8 commit 1c689cb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/tile/kernel/hardwall.c
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,8 @@ static struct hardwall_info *hardwall_create(
/* Allocate a new rectangle optimistically. */
rect = kmalloc(sizeof(struct hardwall_info),
GFP_KERNEL | __GFP_ZERO);
if (rect == NULL)
return ERR_PTR(-ENOMEM);
INIT_LIST_HEAD(&rect->task_head);

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

0 comments on commit 1c689cb

Please sign in to comment.