From: Arnaud Patard Date: Thu, 9 Nov 2006 23:52:34 +0000 (+0200) Subject: dsp_fbexport: use kzalloc X-Git-Tag: v2.6.19-omap1~67 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=becd02ee30408a66d6d2e833ec3efd542b608a56;p=linux-2.6-omap-h63xx.git dsp_fbexport: use kzalloc 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 Signed-off-by: Tony Lindgren --- diff --git a/arch/arm/plat-omap/dsp/dsp_mem.c b/arch/arm/plat-omap/dsp/dsp_mem.c index ac45fafaa5f..b53cdc7e1ba 100644 --- a/arch/arm/plat-omap/dsp/dsp_mem.c +++ b/arch/arm/plat-omap/dsp/dsp_mem.c @@ -1495,7 +1495,7 @@ static int dsp_fbexport(dsp_long_t *dspadr) #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");