From: Jesper Juhl <jesper.juhl@gmail.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: Thomas Hellstrom <thomas@tungstengraphics.com>,
Alan Hourihane <alanh@tungstengraphics.com>,
Jesper Juhl <jesper.juhl@gmail.com>
Subject: [PATCH] cr_backlight_probe allocates too little storage for struct cr_panel
Date: Thu, 19 Jul 2007 01:30:38 +0200 [thread overview]
Message-ID: <200707190130.39067.jesper.juhl@gmail.com> (raw)
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;
reply other threads:[~2007-07-18 23:40 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200707190130.39067.jesper.juhl@gmail.com \
--to=jesper.juhl@gmail.com \
--cc=alanh@tungstengraphics.com \
--cc=linux-kernel@vger.kernel.org \
--cc=thomas@tungstengraphics.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®