From patchwork Sat Jun 18 17:26:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: weiyj_lk@163.com X-Patchwork-Id: 9186375 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 83ADC601C0 for ; Mon, 20 Jun 2016 00:45:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A373200F5 for ; Mon, 20 Jun 2016 00:45:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 46FEA205AD; Mon, 20 Jun 2016 00:45:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 79FBE200F5 for ; Mon, 20 Jun 2016 00:45:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DF7196E088; Mon, 20 Jun 2016 00:45:28 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 931 seconds by postgrey-1.35 at gabe; Sat, 18 Jun 2016 17:42:13 UTC Received: from m12-11.163.com (m12-11.163.com [220.181.12.11]) by gabe.freedesktop.org (Postfix) with ESMTP id 9BFFA6E3DF; Sat, 18 Jun 2016 17:42:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=6Hkp8 x12IQN9DXxfYQcnmDdlt3NSDuKSz4pYYfm2xQg=; b=iAu1mRLbjyyXQd0epcaAL rj8PHnuRqeCqDRujIHjMIhyTkbrRO5JMj9OjWDwaVQnv2Vx8wDip1aEZC8I9Jcxy f944sopSZM/e82ykEND1UXOZrOKqSLxbrUYEaXCGJzy3cNQLFwgTddoEektodqYl knZSWyo9LsWoztlkOWFjeI= Received: from localhost.localdomain.localdomain (unknown [180.102.97.65]) by smtp7 (Coremail) with SMTP id C8CowAC338tNhGVXmB6wAQ--.41683S3; Sun, 19 Jun 2016 01:26:37 +0800 (CST) From: weiyj_lk@163.com To: Rob Clark , airlied@linux.ie, u.kleine-koenig@pengutronix.de Subject: [PATCH -next] drm/msm/dsi: Fix return value check in msm_dsi_host_set_display_mode() Date: Sat, 18 Jun 2016 17:26:37 +0000 Message-Id: <1466270797-3984-1-git-send-email-weiyj_lk@163.com> X-Mailer: git-send-email 2.5.5 MIME-Version: 1.0 X-CM-TRANSID: C8CowAC338tNhGVXmB6wAQ--.41683S3 X-Coremail-Antispam: 1Uf129KBjvdXoW7Wr4kWry3Cw1rGw4UXF18Xwb_yoWfKrg_uF 98XrnIgr42g3ZFkFWjyF43t3sIya4Y9F4FvF15ta4ay34Dtr1rt3savr95ZF1UZF18tF9a kanFvry5AFnrGjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUYe5l5UUUUU== X-Originating-IP: [180.102.97.65] X-CM-SenderInfo: pzhl5yxbonqiywtou0bp/1tbiNRGM1lSIOU0oegABsF X-Mailman-Approved-At: Mon, 20 Jun 2016 00:45:07 +0000 Cc: linux-arm-msm@vger.kernel.org, Wei Yongjun , freedreno@lists.freedesktop.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Wei Yongjun In case of error, the function drm_mode_duplicate() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Signed-off-by: Wei Yongjun Reviewed-by: Archit Taneja --- drivers/gpu/drm/msm/dsi/dsi_host.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c index a3e47ad8..97e5a4d 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -2245,9 +2245,9 @@ int msm_dsi_host_set_display_mode(struct mipi_dsi_host *host, } msm_host->mode = drm_mode_duplicate(msm_host->dev, mode); - if (IS_ERR(msm_host->mode)) { + if (!msm_host->mode) { pr_err("%s: cannot duplicate mode\n", __func__); - return PTR_ERR(msm_host->mode); + return -ENOMEM; } return 0;