Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1614526ybv; Fri, 21 Feb 2020 00:19:03 -0800 (PST) X-Google-Smtp-Source: APXvYqwETk0gQVlFWJtrt7ugN9M+qd7IK7c7Hayi84iG6JthvsG23ksYe0OqMHFZ36A82Kabt/vB X-Received: by 2002:a05:6808:618:: with SMTP id y24mr977260oih.86.1582273143217; Fri, 21 Feb 2020 00:19:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582273143; cv=none; d=google.com; s=arc-20160816; b=gGCGUx4DB62hAlapoOCsufZZuKCJ2FYKEZCY1ZtIxamIUBeWVc4DlSTx4+XXbzeioY PTAJPVuST2r6Ztko+eYZGFPnVKXYfM/I3HRSxGAFZcEaR6r5L16o5t1ToxzfPl4Xep52 DFr8ufCHS1goWk4SSGqtJSyHNL0PY2IL5bCDlYzG5NCNS7Igtc6nonwkrAcbZH10qENs /8GKy88Sfpd1dm5hv5gB0fmSA7xq4TMieifzP+jeGYI+wJDDYrRnOfKUTubkSmZ0etHs MW6UjOPmrC8bKE1K35P2nhIO6CbSoyt89wqokEcz0LKekHylsnK+QdpK/9HCHEqnVnYY vLgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=KsQqB1POqy0ZhfEgvrbAmX+rO5Wkwctg1q+YGNaxI8Y=; b=Yoe+HsoE/DPy1nL55NjKBSi9hBar5eeBYmJf/7tjJS0wM/jcAAH0wSwVDAf59sReDe SaxivWZAo3O68DoPOpiSybmpfNjorkCEPcXWwecRnMgTnEPVSscqiylWoFYsTu4cNH1u mmCP4/dnbjpkrDfwSZcphVyTiXrh1+5zGi8zrxiHypU234w/eCDpYCdNNK/a/5EUrWm5 +bMUnW1axuqv2co5GrV++dAYtjm6KqGu4vsnSs4AbxTNXrRaBdupjzr27sW4wx7fZpn8 Zhe9P659+Jxg7cbBHb5X3+f6PoprHxXWfCB0zqg2p2q1wGCueCHV7IDsyxXIJVHSk0j1 1lWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YyovZI84; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l15si467490oic.220.2020.02.21.00.18.51; Fri, 21 Feb 2020 00:19:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YyovZI84; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387629AbgBUIRI (ORCPT + 99 others); Fri, 21 Feb 2020 03:17:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:54384 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733162AbgBUIRG (ORCPT ); Fri, 21 Feb 2020 03:17:06 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5C90E24685; Fri, 21 Feb 2020 08:17:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582273025; bh=+zIrdqNPkEd6fY5EVhJZkgvBuBmEdUWSwmsgVa5DgUQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YyovZI84AY0pdMufQiUUQWMbXh9VnwtqCkMXKBcGS64S4lT5p5HGjCiW0le+q3MOi uhs6F9fq2L24GnG5BZQjTLURhlkYQJYr3NaZgjxN4Y2E3IEX//q6o3YS7hQ9BtrH/M KR+eYXsEMbW/cyfRTaVUkc4eQQs3ZHy9fy6YHHs8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe JAILLET , Lubomir Rintel , YueHaibing , Bartlomiej Zolnierkiewicz , Sasha Levin Subject: [PATCH 4.19 020/191] pxa168fb: Fix the function used to release some memory in an error handling path Date: Fri, 21 Feb 2020 08:39:53 +0100 Message-Id: <20200221072253.625455694@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200221072250.732482588@linuxfoundation.org> References: <20200221072250.732482588@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christophe JAILLET [ 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 Reviewed-by: Lubomir Rintel CC: YueHaibing Signed-off-by: Bartlomiej Zolnierkiewicz Link: https://patchwork.freedesktop.org/patch/msgid/20190831100024.3248-1-christophe.jaillet@wanadoo.fr Signed-off-by: Sasha Levin --- 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 @@ failed_free_cmap: 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