All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org>
To: linux-omap-open-source@linux.omap.com
Subject: [PATCH] dsp_fbexport: use kzalloc
Date: Wed, 08 Nov 2006 11:58:24 +0100	[thread overview]
Message-ID: <85odridx2n.fsf@orfeo.duckcorp.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 426 bytes --]


The dsp_export function calls omapfb_register_client() right after
allocating the memory with kmalloc. 
A commit added to omapfb_register_client() a check on the value of
plane_idx in the notified block structure. As we're only using kmalloc,
you may end-up comparing garbage/random values (It even leads to a oops
on my n770). 
Using kzalloc() fixes the issue.

Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
---


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: dsp_video_register_client.patch --]
[-- Type: text/x-patch, Size: 778 bytes --]

---
 arch/arm/plat-omap/dsp/dsp_mem.c |    2 	1 +	1 -	0 !
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-omap-2.6/arch/arm/plat-omap/dsp/dsp_mem.c
===================================================================
--- linux-omap-2.6.orig/arch/arm/plat-omap/dsp/dsp_mem.c	2006-11-07 23:43:12.000000000 +0100
+++ linux-omap-2.6/arch/arm/plat-omap/dsp/dsp_mem.c	2006-11-07 23:43:30.000000000 +0100
@@ -1495,7 +1495,7 @@ static int dsp_fbexport(dsp_long_t *dspa
 #endif
 
 #ifdef CONFIG_FB_OMAP_LCDC_EXTERNAL
-	omapfb_nb = kmalloc(sizeof(struct omapfb_notifier_block), GFP_KERNEL);
+	omapfb_nb = kzalloc(sizeof(struct omapfb_notifier_block), GFP_KERNEL);
 	if (omapfb_nb == NULL) {
 		printk(KERN_ERR
 		       "omapdsp: failed to allocate memory for omapfb_nb!\n");

[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



             reply	other threads:[~2006-11-08 10:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-08 10:58 Arnaud Patard [this message]
2006-11-09 23:52 ` [PATCH] dsp_fbexport: use kzalloc Tony Lindgren

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=85odridx2n.fsf@orfeo.duckcorp.org \
    --to=arnaud.patard@rtp-net.org \
    --cc=linux-omap-open-source@linux.omap.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.