diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2016-06-18 13:26:37 -0400 |
---|---|---|
committer | Rob Clark <robdclark@gmail.com> | 2016-07-16 10:29:28 -0400 |
commit | 2abe1f2509bf4976dce9a220cab3f1424f0cbb0f (patch) | |
tree | 172be60ec0015c227885d0ac45968073b23c7927 | |
parent | f14270161a236235537338d042015988aac354f9 (diff) |
drm/msm/dsi: Fix return value check in msm_dsi_host_set_display_mode()
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>
Reviewed-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
-rw-r--r-- | drivers/gpu/drm/msm/dsi/dsi_host.c | 4 |
1 files 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 ddc4c7d678ed..f05ed0e1f3d6 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c | |||
@@ -2278,9 +2278,9 @@ int msm_dsi_host_set_display_mode(struct mipi_dsi_host *host, | |||
2278 | } | 2278 | } |
2279 | 2279 | ||
2280 | msm_host->mode = drm_mode_duplicate(msm_host->dev, mode); | 2280 | msm_host->mode = drm_mode_duplicate(msm_host->dev, mode); |
2281 | if (IS_ERR(msm_host->mode)) { | 2281 | if (!msm_host->mode) { |
2282 | pr_err("%s: cannot duplicate mode\n", __func__); | 2282 | pr_err("%s: cannot duplicate mode\n", __func__); |
2283 | return PTR_ERR(msm_host->mode); | 2283 | return -ENOMEM; |
2284 | } | 2284 | } |
2285 | 2285 | ||
2286 | return 0; | 2286 | return 0; |