Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757283AbbDPM1Y (ORCPT ); Thu, 16 Apr 2015 08:27:24 -0400 Received: from m12-15.163.com ([220.181.12.15]:41076 "EHLO m12-15.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752367AbbDPM1P (ORCPT ); Thu, 16 Apr 2015 08:27:15 -0400 X-Coremail-DSSMTP: 49.77.26.90 From: weiyj_lk@163.com To: David Airlie , Dave Airlie , Thierry Reding , Benjamin Gaignard Cc: Wei Yongjun , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH] drm/sti: fix return value check in sti_dvo_probe() Date: Thu, 16 Apr 2015 20:19:24 +0800 Message-Id: <1429186764-20812-1-git-send-email-weiyj_lk@163.com> X-Mailer: git-send-email 2.1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-CM-TRANSID: D8CowEAJdUvNqC9Vpmh4Ag--.98S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7WryUXryrJrykKrWxurWDtwb_yoWfCwc_C3 yrZrn3XFZrWF1qqF42kw4avF9ayF4DuFWkXr1Fya4fJrW7tr17XayxWryUuF1DXws8KFZr t392vr1akr9xGjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUnXdjtUUUUU== X-Originating-IP: [49.77.26.90] X-CM-SenderInfo: pzhl5yxbonqiywtou0bp/1tbioxTd1lULzUPGNwAAsd Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1116 Lines: 32 From: Wei Yongjun In case of error, the function devm_ioremap_nocache() returns NULL not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Signed-off-by: Wei Yongjun --- drivers/gpu/drm/sti/sti_dvo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/sti/sti_dvo.c b/drivers/gpu/drm/sti/sti_dvo.c index aeb5070..ae4c3df 100644 --- a/drivers/gpu/drm/sti/sti_dvo.c +++ b/drivers/gpu/drm/sti/sti_dvo.c @@ -495,8 +495,8 @@ static int sti_dvo_probe(struct platform_device *pdev) } dvo->regs = devm_ioremap_nocache(dev, res->start, resource_size(res)); - if (IS_ERR(dvo->regs)) - return PTR_ERR(dvo->regs); + if (!dvo->regs) + return -ENOMEM; dvo->clk_pix = devm_clk_get(dev, "dvo_pix"); if (IS_ERR(dvo->clk_pix)) { -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/