Skip to contentSkip to conversation

gru: allocation may fail in quicktest1()

PATCH In review Roel Kluin 2 participants 2 messages Aug 31, 2009 Char and misc drivers

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 gru: allocation may fail in quicktest1()

The allocation may fail.

---

drivers/misc/sgi-gru/grukservices.c +2 -0
index 79689b1..766e21e 100644
@@ -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;
Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · Roel Kluin

The allocation may fail.

Quoted 14 lines

---

drivers/misc/sgi-gru/grukservices.c +2 -0
index 79689b1..766e21e 100644
@@ -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;