* [PATCH 03/15] arch/tile: check kmalloc() result
@ 2010-07-16 16:13 Kulikov Vasiliy
0 siblings, 0 replies; only message in thread
From: Kulikov Vasiliy @ 2010-07-16 16:13 UTC (permalink / raw)
To: kernel-janitors; +Cc: Chris Metcalf, Arnd Bergmann, linux-kernel
If kmalloc() fails exit with -ENOMEM.
Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
---
arch/tile/kernel/hardwall.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/arch/tile/kernel/hardwall.c b/arch/tile/kernel/hardwall.c
index 7bf0627..584b965 100644
--- a/arch/tile/kernel/hardwall.c
+++ b/arch/tile/kernel/hardwall.c
@@ -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. */
--
1.7.0.4
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-07-16 16:13 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-16 16:13 [PATCH 03/15] arch/tile: check kmalloc() result Kulikov Vasiliy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome