Skip to contentSkip to conversation

/drivers/video/backlight/tdo24m - crash on kmalloc

PATCH In review Aviv Laufer 3 participants 3 messages Jun 23, 2009 – Jun 29, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 /drivers/video/backlight/tdo24m - crash on kmalloc

There is a crash in tdo24m module caused by a call to kmalloc with the second parameter sizeof(flag) instead of flag.

---

--- linux-2.6.30/drivers/video/backlight/tdo24m.c.orig 2009-06-23
15:08:02.000000000 +0300
+++ linux-2.6.30/drivers/video/backlight/tdo24m.c 2009-06-23
15:09:05.000000000 +0300
@@ -356,7 +356,7 @@ static int __devinit tdo24m_probe(struct
lcd->power = FB_BLANK_POWERDOWN;
lcd->mode = MODE_VGA; /* default to VGA */

- lcd->buf = kmalloc(TDO24M_SPI_BUFF_SIZE, sizeof(GFP_KERNEL));
+ lcd->buf = kmalloc(TDO24M_SPI_BUFF_SIZE, GFP_KERNEL);
if (lcd->buf == NULL) {
kfree(lcd);
return -ENOMEM;

#1 lore raw
Quoted 4 lines · Aviv Laufer

There is a crash in tdo24m module caused by a call to kmalloc with the second parameter sizeof(flag) instead of flag.

Thanks, its been queued for Linus in the backlight tree.

Cheers,

Richard

Signature · 2 lines
Richard Purdie
Intel Open Source Technology Centre
Acked-by on v1 1/1
#2 lore raw
In reply to Aviv Laufer
Quoted 4 lines · Aviv Laufer

There is a crash in tdo24m module caused by a call to kmalloc with the second parameter sizeof(flag) instead of flag.

Quoted 21 lines

---

--- linux-2.6.30/drivers/video/backlight/tdo24m.c.orig 2009-06-23
15:08:02.000000000 +0300
+++ linux-2.6.30/drivers/video/backlight/tdo24m.c 2009-06-23
15:09:05.000000000 +0300

(quoted diff) +1 -2
@@ -356,7 +356,7 @@ static int __devinit tdo24m_probe(struct
 	lcd->power = FB_BLANK_POWERDOWN;
 	lcd->mode = MODE_VGA;	/* default to VGA */
 
-	lcd->buf = kmalloc(TDO24M_SPI_BUFF_SIZE, sizeof(GFP_KERNEL));
+	lcd->buf = kmalloc(TDO24M_SPI_BUFF_SIZE, GFP_KERNEL);
 	if (lcd->buf == NULL) {
 		kfree(lcd);
 		return -ENOMEM;
--

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/