Linux-Renesas-SoC Archive on lore.kernel.org
 help / color / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: YueHaibing <yuehaibing@huawei.com>,
	Simon Horman <horms+renesas@verge.net.au>,
	Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
	Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
	Sasha Levin <sashal@kernel.org>,
	dri-devel@lists.freedesktop.org,
	linux-renesas-soc@vger.kernel.org
Subject: [PATCH AUTOSEL 4.19 111/671] drm/shmob: Fix return value check in shmob_drm_probe
Date: Thu, 16 Jan 2020 11:45:42 -0500
Message-ID: <20200116165502.8838-111-sashal@kernel.org> (raw)
In-Reply-To: <20200116165502.8838-1-sashal@kernel.org>

From: YueHaibing <yuehaibing@huawei.com>

[ Upstream commit 06c3bbd3c12737a50c2e981821b5585e1786e73d ]

In case of error, the function devm_ioremap_resource() returns ERR_PTR()
and never returns NULL. The NULL test in the return value check should
be replaced with IS_ERR().

Fixes: 8f1597c8f1a5 ("drm: shmobile: Perform initialization/cleanup at probe/remove time")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/shmobile/shmob_drm_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/shmobile/shmob_drm_drv.c b/drivers/gpu/drm/shmobile/shmob_drm_drv.c
index 592572554eb0..58d8a98c749b 100644
--- a/drivers/gpu/drm/shmobile/shmob_drm_drv.c
+++ b/drivers/gpu/drm/shmobile/shmob_drm_drv.c
@@ -233,8 +233,8 @@ static int shmob_drm_probe(struct platform_device *pdev)
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	sdev->mmio = devm_ioremap_resource(&pdev->dev, res);
-	if (sdev->mmio == NULL)
-		return -ENOMEM;
+	if (IS_ERR(sdev->mmio))
+		return PTR_ERR(sdev->mmio);
 
 	ret = shmob_drm_setup_clocks(sdev, pdata->clk_source);
 	if (ret < 0)
-- 
2.20.1


      parent reply index

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200116165502.8838-1-sashal@kernel.org>
2020-01-16 16:44 ` [PATCH AUTOSEL 4.19 053/671] drm: rcar-du: Fix the return value in case of error in 'rcar_du_crtc_set_crc_source()' Sasha Levin
2020-01-16 16:44 ` [PATCH AUTOSEL 4.19 054/671] drm: rcar-du: Fix vblank initialization Sasha Levin
2020-01-16 16:44 ` [PATCH AUTOSEL 4.19 058/671] arm64: dts: renesas: r8a7795-es1: Add missing power domains to IPMMU nodes Sasha Levin
2020-01-16 16:44 ` [PATCH AUTOSEL 4.19 068/671] pinctrl: sh-pfc: r8a7740: Add missing REF125CK pin to gether_gmii group Sasha Levin
2020-01-16 16:45 ` [PATCH AUTOSEL 4.19 069/671] pinctrl: sh-pfc: r8a7740: Add missing LCD0 marks to lcd0_data24_1 group Sasha Levin
2020-01-16 16:45 ` [PATCH AUTOSEL 4.19 070/671] pinctrl: sh-pfc: r8a7791: Remove bogus ctrl marks from qspi_data4_b group Sasha Levin
2020-01-16 16:45 ` [PATCH AUTOSEL 4.19 071/671] pinctrl: sh-pfc: r8a7791: Remove bogus marks from vin1_b_data18 group Sasha Levin
2020-01-16 16:45 ` [PATCH AUTOSEL 4.19 072/671] pinctrl: sh-pfc: sh73a0: Add missing TO pin to tpu4_to3 group Sasha Levin
2020-01-16 16:45 ` [PATCH AUTOSEL 4.19 073/671] pinctrl: sh-pfc: r8a7794: Remove bogus IPSR9 field Sasha Levin
2020-01-16 16:45 ` [PATCH AUTOSEL 4.19 074/671] pinctrl: sh-pfc: r8a77970: Add missing MOD_SEL0 field Sasha Levin
2020-01-16 16:45 ` [PATCH AUTOSEL 4.19 075/671] pinctrl: sh-pfc: r8a77980: " Sasha Levin
2020-01-16 16:45 ` [PATCH AUTOSEL 4.19 076/671] pinctrl: sh-pfc: sh7734: Add missing IPSR11 field Sasha Levin
2020-01-16 16:45 ` [PATCH AUTOSEL 4.19 077/671] pinctrl: sh-pfc: r8a77995: Remove bogus SEL_PWM[0-3]_3 configurations Sasha Levin
2020-01-16 16:45 ` [PATCH AUTOSEL 4.19 078/671] pinctrl: sh-pfc: sh7269: Add missing PCIOR0 field Sasha Levin
2020-01-16 16:45 ` [PATCH AUTOSEL 4.19 079/671] pinctrl: sh-pfc: sh7734: Remove bogus IPSR10 value Sasha Levin
2020-01-16 16:45 ` [PATCH AUTOSEL 4.19 103/671] ARM: dts: r8a7743: Remove generic compatible string from iic3 Sasha Levin
2020-01-16 16:45 ` [PATCH AUTOSEL 4.19 104/671] ARM: dts: r8a7743: Fix sorting of rwdt node Sasha Levin
2020-01-17  9:32   ` Sergei Shtylyov
2020-01-23 14:19     ` Sasha Levin
2020-01-16 16:45 ` Sasha Levin [this message]

Reply instructions:

You may reply publically 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=20200116165502.8838-111-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=horms+renesas@verge.net.au \
    --cc=kieran.bingham+renesas@ideasonboard.com \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --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

Linux-Renesas-SoC Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-renesas-soc/0 linux-renesas-soc/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-renesas-soc linux-renesas-soc/ https://lore.kernel.org/linux-renesas-soc \
		linux-renesas-soc@vger.kernel.org
	public-inbox-index linux-renesas-soc

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-renesas-soc


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git