linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] drm/msm/dsi: Fix return value check in msm_dsi_host_set_display_mode()
@ 2016-06-18 17:26 weiyj_lk
       [not found] ` <1466270797-3984-1-git-send-email-weiyj_lk-9Onoh4P/yGk@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: weiyj_lk @ 2016-06-18 17:26 UTC (permalink / raw)
  To: Rob Clark, airlied, u.kleine-koenig
  Cc: Wei Yongjun, linux-arm-msm, dri-devel, freedreno

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

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 <yongjun_wei@trendmicro.com.cn>
---
 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;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-06-20  4:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-18 17:26 [PATCH -next] drm/msm/dsi: Fix return value check in msm_dsi_host_set_display_mode() weiyj_lk
     [not found] ` <1466270797-3984-1-git-send-email-weiyj_lk-9Onoh4P/yGk@public.gmane.org>
2016-06-20  4:15   ` Archit Taneja

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).