drm/rockchip: drv: Fix drm_atomic_helper_duplicate_state() error check

Use IS_ERR() instead of checking for a NULL pointer when calling for
drm_atomic_helper_duplicate_state() failures.
drm_atomic_helper_duplicate_state() return an ERR_PTR()-encoded error
code on failure.

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I95388698239a7e1bd2bfbedd2bd921bbf52372f0
This commit is contained in:
Tao Huang
2022-07-27 09:29:09 +08:00
parent 6664d4c21d
commit 4df9208b4e

View File

@@ -1167,7 +1167,7 @@ static void rockchip_drm_set_property_default(struct drm_device *drm)
drm_modeset_lock_all(drm);
state = drm_atomic_helper_duplicate_state(drm, conf->acquire_ctx);
if (!state) {
if (IS_ERR(state)) {
DRM_ERROR("failed to alloc atomic state\n");
goto err_unlock;
}