aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2019-08-31 12:00:24 +0200
committerBen Hutchings <ben@decadent.org.uk>2020-05-22 21:19:22 +0100
commitdfae25c5d2107bdfec7a06bdf910a27b24af6bd6 (patch)
tree315723e89ac0b6764540eab3f869eba599a4de6e
parentd477b3d95293c0b8c05a547973d43a150b4ca5b2 (diff)
downloadlinux-stable-dfae25c5d2107bdfec7a06bdf910a27b24af6bd6.tar.gz
pxa168fb: Fix the function used to release some memory in an error handling path
commit 3c911fe799d1c338d94b78e7182ad452c37af897 upstream. In the probe function, some resources are allocated using 'dma_alloc_wc()', they should be released with 'dma_free_wc()', not 'dma_free_coherent()'. We already use 'dma_free_wc()' in the remove function, but not in the error handling path of the probe function. Also, remove a useless 'PAGE_ALIGN()'. 'info->fix.smem_len' is already PAGE_ALIGNed. Fixes: 638772c7553f ("fb: add support of LCD display controller on pxa168/910 (base layer)") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: Lubomir Rintel <lkundrak@v3.sk> CC: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190831100024.3248-1-christophe.jaillet@wanadoo.fr [bwh: Backported to 3.16: Use dma_free_writecombine().] Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r--drivers/video/fbdev/pxa168fb.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/video/fbdev/pxa168fb.c b/drivers/video/fbdev/pxa168fb.c
index c95b9e46d48ff3..d24018124d11ce 100644
--- a/drivers/video/fbdev/pxa168fb.c
+++ b/drivers/video/fbdev/pxa168fb.c
@@ -772,8 +772,8 @@ failed_free_cmap:
failed_free_clk:
clk_disable(fbi->clk);
failed_free_fbmem:
- dma_free_coherent(fbi->dev, info->fix.smem_len,
- info->screen_base, fbi->fb_start_dma);
+ dma_free_writecombine(fbi->dev, info->fix.smem_len,
+ info->screen_base, fbi->fb_start_dma);
failed_free_info:
kfree(info);
failed_put_clk:
@@ -809,7 +809,7 @@ static int pxa168fb_remove(struct platform_device *pdev)
irq = platform_get_irq(pdev, 0);
- dma_free_writecombine(fbi->dev, PAGE_ALIGN(info->fix.smem_len),
+ dma_free_writecombine(fbi->dev, info->fix.smem_len,
info->screen_base, info->fix.smem_start);
clk_disable(fbi->clk);