mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-01 22:54:01 +00:00
pxa168fb: Fix the function used to release some memory in an error handling path
[ Upstream commit3c911fe799
] 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:638772c755
("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 Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
e5c8d49b9b
commit
8cc5aa5ce6
1 changed files with 3 additions and 3 deletions
|
@ -769,8 +769,8 @@ static int pxa168fb_probe(struct platform_device *pdev)
|
|||
failed_free_clk:
|
||||
clk_disable_unprepare(fbi->clk);
|
||||
failed_free_fbmem:
|
||||
dma_free_coherent(fbi->dev, info->fix.smem_len,
|
||||
info->screen_base, fbi->fb_start_dma);
|
||||
dma_free_wc(fbi->dev, info->fix.smem_len,
|
||||
info->screen_base, fbi->fb_start_dma);
|
||||
failed_free_info:
|
||||
kfree(info);
|
||||
|
||||
|
@ -804,7 +804,7 @@ static int pxa168fb_remove(struct platform_device *pdev)
|
|||
|
||||
irq = platform_get_irq(pdev, 0);
|
||||
|
||||
dma_free_wc(fbi->dev, PAGE_ALIGN(info->fix.smem_len),
|
||||
dma_free_wc(fbi->dev, info->fix.smem_len,
|
||||
info->screen_base, info->fix.smem_start);
|
||||
|
||||
clk_disable_unprepare(fbi->clk);
|
||||
|
|
Loading…
Reference in a new issue