提交 d5400aab 编写于 作者: L Leo (Sunpeng) Li 提交者: Alex Deucher

drm/amd/display: Use correct error codes

Should return -ENOMEM when allocation fails.
Also, just return the error code instead of using a variable.
Signed-off-by: NLeo (Sunpeng) Li <sunpeng.li@amd.com>
Reviewed-by: NHarry Wentland <Harry.Wentland@amd.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 8c45c5db
...@@ -4761,10 +4761,8 @@ static int dm_update_planes_state(struct dc *dc, ...@@ -4761,10 +4761,8 @@ static int dm_update_planes_state(struct dc *dc,
WARN_ON(dm_new_plane_state->dc_state); WARN_ON(dm_new_plane_state->dc_state);
dc_new_plane_state = dc_create_plane_state(dc); dc_new_plane_state = dc_create_plane_state(dc);
if (!dc_new_plane_state) { if (!dc_new_plane_state)
ret = -EINVAL; return -ENOMEM;
return ret;
}
DRM_DEBUG_DRIVER("Enabling DRM plane: %d on DRM crtc %d\n", DRM_DEBUG_DRIVER("Enabling DRM plane: %d on DRM crtc %d\n",
plane->base.id, new_plane_crtc->base.id); plane->base.id, new_plane_crtc->base.id);
...@@ -4793,8 +4791,7 @@ static int dm_update_planes_state(struct dc *dc, ...@@ -4793,8 +4791,7 @@ static int dm_update_planes_state(struct dc *dc,
dm_state->context)) { dm_state->context)) {
dc_plane_state_release(dc_new_plane_state); dc_plane_state_release(dc_new_plane_state);
ret = -EINVAL; return -EINVAL;
return ret;
} }
dm_new_plane_state->dc_state = dc_new_plane_state; dm_new_plane_state->dc_state = dc_new_plane_state;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册