Browse Source

gru: allocation may fail in quicktest1()

The allocation may fail.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Roel Kluin 15 years ago
parent
commit
9e5f1138d7
1 changed files with 2 additions and 0 deletions
  1. 2 0
      drivers/misc/sgi-gru/grukservices.c

+ 2 - 0
drivers/misc/sgi-gru/grukservices.c

@@ -937,6 +937,8 @@ static int quicktest1(unsigned long arg)
 
 	/* Need  1K cacheline aligned that does not cross page boundary */
 	p = kmalloc(4096, 0);
+	if (p == NULL)
+		return -ENOMEM;
 	mq = ALIGNUP(p, 1024);
 	memset(mes, 0xee, sizeof(mes));
 	dw = mq;