Commit becd02ee authored by Arnaud Patard's avatar Arnaud Patard Committed by Tony Lindgren

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: default avatarArnaud Patard <arnaud.patard@rtp-net.org>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent d5c772f5
......@@ -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");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment