mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH]  cr_backlight_probe allocates too little storage for struct cr_panel
@ 2007-07-18 23:30 Jesper Juhl
  0 siblings, 0 replies; only message in thread
From: Jesper Juhl @ 2007-07-18 23:30 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: Thomas Hellstrom, Alan Hourihane, Jesper Juhl

Hi,

The Coverity checker noticed that we allocate too little storage 
for "struct cr_panel *crp" in cr_backlight_probe().
We allocate sizeof(crp) where we should really be 
allocating sizeof(*crp) - or sizeof(struct cr_panel) - I 
chose the first notation.
This patch should fix the problem.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
---

 drivers/video/backlight/cr_bllcd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/backlight/cr_bllcd.c b/drivers/video/backlight/cr_bllcd.c
index e9bbc34..1b3f658 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;
 



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-07-18 23:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-18 23:30 [PATCH] cr_backlight_probe allocates too little storage for struct cr_panel Jesper Juhl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®