mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-30 04:46:45 +07:00
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>
This commit is contained in:
parent
f14270161a
commit
2abe1f2509
@ -2278,9 +2278,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;
|
||||
|
Loading…
Reference in New Issue
Block a user