dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Sasha Levin <sashal@kernel.org>,
	linux-fbdev@vger.kernel.org,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	YueHaibing <yuehaibing@huawei.com>,
	dri-devel@lists.freedesktop.org, Lubomir Rintel <lkundrak@v3.sk>,
	Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Subject: [PATCH AUTOSEL 4.14 014/186] pxa168fb: Fix the function used to release some memory in an error handling path
Date: Fri, 14 Feb 2020 11:14:23 -0500	[thread overview]
Message-ID: <20200214161715.18113-14-sashal@kernel.org> (raw)
In-Reply-To: <20200214161715.18113-1-sashal@kernel.org>

From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

[ Upstream commit 3c911fe799d1c338d94b78e7182ad452c37af897 ]

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
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/video/fbdev/pxa168fb.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/pxa168fb.c b/drivers/video/fbdev/pxa168fb.c
index d059d04c63acd..20195d3dbf088 100644
--- a/drivers/video/fbdev/pxa168fb.c
+++ b/drivers/video/fbdev/pxa168fb.c
@@ -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);
-- 
2.20.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2020-02-14 16:17 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-14 16:14 [PATCH AUTOSEL 4.14 001/186] drm/amdgpu: remove set but not used variable 'mc_shared_chmap' from 'gfx_v6_0.c' and 'gfx_v7_0.c' Sasha Levin
2020-02-14 16:14 ` [PATCH AUTOSEL 4.14 002/186] drm/gma500: Fixup fbdev stolen size usage evaluation Sasha Levin
2020-02-14 16:14 ` Sasha Levin [this message]
2020-02-14 16:14 ` [PATCH AUTOSEL 4.14 046/186] drm/amdgpu: remove 4 set but not used variable in amdgpu_atombios_get_connector_info_from_object_table Sasha Levin
2020-02-14 16:14 ` [PATCH AUTOSEL 4.14 047/186] drm/amdgpu: remove set but not used variable 'dig_connector' Sasha Levin
2020-02-14 16:14 ` [PATCH AUTOSEL 4.14 048/186] drm/amdgpu: remove set but not used variable 'dig' Sasha Levin
2020-02-14 16:14 ` [PATCH AUTOSEL 4.14 049/186] drm/amdgpu: remove always false comparison in 'amdgpu_atombios_i2c_process_i2c_ch' Sasha Levin
2020-02-14 16:14 ` [PATCH AUTOSEL 4.14 050/186] drm/amdgpu: remove set but not used variable 'mc_shared_chmap' Sasha Levin
2020-02-14 16:15 ` [PATCH AUTOSEL 4.14 051/186] drm/amdgpu: remove set but not used variable 'amdgpu_connector' Sasha Levin
2020-02-14 16:15 ` [PATCH AUTOSEL 4.14 052/186] drm/gma500: remove set but not used variable 'htotal' Sasha Levin
2020-02-14 16:15 ` [PATCH AUTOSEL 4.14 053/186] drm/gma500: remove set but not used variable 'error' Sasha Levin
2020-02-14 16:15 ` [PATCH AUTOSEL 4.14 054/186] drm/gma500: remove set but not used variable 'is_hdmi', 'is_crt' Sasha Levin
2020-02-14 16:15 ` [PATCH AUTOSEL 4.14 055/186] drm/gma500: remove set but not used variable 'channel_eq' Sasha Levin
2020-02-14 16:15 ` [PATCH AUTOSEL 4.14 056/186] drm/radeon: remove set but not used variable 'size', 'relocs_chunk' Sasha Levin
2020-02-14 16:15 ` [PATCH AUTOSEL 4.14 057/186] drm/radeon: remove set but not used variable 'backbias_response_time' Sasha Levin
2020-02-14 16:15 ` [PATCH AUTOSEL 4.14 058/186] drm/radeon: remove set but not used variable 'dig_connector' Sasha Levin
2020-02-14 16:15 ` [PATCH AUTOSEL 4.14 059/186] drm/radeon: remove set but not used variable 'radeon_connector' Sasha Levin
2020-02-14 16:15 ` [PATCH AUTOSEL 4.14 060/186] drm/radeon: remove set but not used variable 'blocks' Sasha Levin
2020-02-14 16:15 ` [PATCH AUTOSEL 4.14 061/186] drm/radeon: remove set but not used variable 'tv_pll_cntl1' Sasha Levin
2020-02-14 16:15 ` [PATCH AUTOSEL 4.14 087/186] drm/mediatek: handle events when enabling/disabling crtc Sasha Levin
2020-02-14 16:15 ` [PATCH AUTOSEL 4.14 102/186] drm: remove the newline for CRC source name Sasha Levin
2020-02-14 16:15 ` [PATCH AUTOSEL 4.14 103/186] drm/gma500: remove set but not used variables 'hist_reg' Sasha Levin
2020-02-14 16:16 ` [PATCH AUTOSEL 4.14 125/186] drm/nouveau/secboot/gm20b: initialize pointer in gm20b_secboot_new() Sasha Levin
2020-02-14 16:16 ` [PATCH AUTOSEL 4.14 126/186] drm/nouveau/gr/gk20a, gm200-: add terminators to method lists read from fw Sasha Levin
2020-02-14 16:16 ` [PATCH AUTOSEL 4.14 127/186] drm/nouveau: Fix copy-paste error in nouveau_fence_wait_uevent_handler Sasha Levin
2020-02-14 16:16 ` [PATCH AUTOSEL 4.14 128/186] drm/vmwgfx: prevent memory leak in vmw_cmdbuf_res_add Sasha Levin
2020-02-14 16:16 ` [PATCH AUTOSEL 4.14 170/186] drm/nouveau/disp/nv50-: prevent oops when no channel method map provided Sasha Levin
2020-02-14 16:17 ` [PATCH AUTOSEL 4.14 174/186] radeon: insert 10ms sleep in dce5_crtc_load_lut Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200214161715.18113-14-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=b.zolnierkie@samsung.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkundrak@v3.sk \
    --cc=stable@vger.kernel.org \
    --cc=yuehaibing@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).