Commit de145b44 authored by Michael Hennerich's avatar Michael Hennerich Committed by Linus Torvalds

fbdev: bfin-t350mcqb-fb: fix fbmem allocation with blanking lines

The current allocation does not include the memory required for blanking
lines.  So avoid memory corruption when multiple devices are using the DMA
memory near each other.
Signed-off-by: default avatarMichael Hennerich <michael.hennerich@analog.com>
Signed-off-by: default avatarMike Frysinger <vapier@gentoo.org>
Cc: <stable@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 747388d7
...@@ -488,9 +488,9 @@ static int __devinit bfin_t350mcqb_probe(struct platform_device *pdev) ...@@ -488,9 +488,9 @@ static int __devinit bfin_t350mcqb_probe(struct platform_device *pdev)
fbinfo->fbops = &bfin_t350mcqb_fb_ops; fbinfo->fbops = &bfin_t350mcqb_fb_ops;
fbinfo->flags = FBINFO_FLAG_DEFAULT; fbinfo->flags = FBINFO_FLAG_DEFAULT;
info->fb_buffer = info->fb_buffer = dma_alloc_coherent(NULL, fbinfo->fix.smem_len +
dma_alloc_coherent(NULL, fbinfo->fix.smem_len, &info->dma_handle, ACTIVE_VIDEO_MEM_OFFSET,
GFP_KERNEL); &info->dma_handle, GFP_KERNEL);
if (NULL == info->fb_buffer) { if (NULL == info->fb_buffer) {
printk(KERN_ERR DRIVER_NAME printk(KERN_ERR DRIVER_NAME
...@@ -568,8 +568,8 @@ static int __devinit bfin_t350mcqb_probe(struct platform_device *pdev) ...@@ -568,8 +568,8 @@ static int __devinit bfin_t350mcqb_probe(struct platform_device *pdev)
out6: out6:
fb_dealloc_cmap(&fbinfo->cmap); fb_dealloc_cmap(&fbinfo->cmap);
out4: out4:
dma_free_coherent(NULL, fbinfo->fix.smem_len, info->fb_buffer, dma_free_coherent(NULL, fbinfo->fix.smem_len + ACTIVE_VIDEO_MEM_OFFSET,
info->dma_handle); info->fb_buffer, info->dma_handle);
out3: out3:
framebuffer_release(fbinfo); framebuffer_release(fbinfo);
out2: out2:
...@@ -592,8 +592,9 @@ static int __devexit bfin_t350mcqb_remove(struct platform_device *pdev) ...@@ -592,8 +592,9 @@ static int __devexit bfin_t350mcqb_remove(struct platform_device *pdev)
free_irq(info->irq, info); free_irq(info->irq, info);
if (info->fb_buffer != NULL) if (info->fb_buffer != NULL)
dma_free_coherent(NULL, fbinfo->fix.smem_len, info->fb_buffer, dma_free_coherent(NULL, fbinfo->fix.smem_len +
info->dma_handle); ACTIVE_VIDEO_MEM_OFFSET, info->fb_buffer,
info->dma_handle);
fb_dealloc_cmap(&fbinfo->cmap); fb_dealloc_cmap(&fbinfo->cmap);
......
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