From: Jesper Juhl <jesper.juhl@gmail.com>
Date: Fri, 20 Jul 2007 07:31:47 +0000 (-0700)
Subject: cr_backlight_probe() allocates too little storage for struct cr_panel
X-Git-Tag: v2.6.23-rc1~223
X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=e3bbb3f05339de438faf54124f25c92e6fe4ac2e;p=linux-2.6-omap-h63xx.git

cr_backlight_probe() allocates too little storage for struct cr_panel

The Coverity checker noticed that we allocate too little storage for
"struct cr_panel *crp" in cr_backlight_probe().

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Cc: Thomas Hellstrom <thomas@tungstengraphics.com>
Cc: Alan Hourihane <alanh@tungstengraphics.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
---

diff --git a/drivers/video/backlight/cr_bllcd.c b/drivers/video/backlight/cr_bllcd.c
index e9bbc3455c9..1b3f6586bc9 100644
--- a/drivers/video/backlight/cr_bllcd.c
+++ b/drivers/video/backlight/cr_bllcd.c
@@ -174,7 +174,7 @@ static int cr_backlight_probe(struct platform_device *pdev)
 	struct cr_panel *crp;
 	u8 dev_en;
 
-	crp = kzalloc(sizeof(crp), GFP_KERNEL);
+	crp = kzalloc(sizeof(*crp), GFP_KERNEL);
 	if (crp == NULL)
 		return -ENOMEM;