drm/amd/display: Don't use target before null check
It might blow up. Signed-off-by: Harry Wentland <harry.wentland@amd.com> Reviewed-by: Tony Cheng <Tony.Cheng@amd.com> Acked-by: Harry Wentland <Harry.Wentland@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Alex Deucher
parent
e12078c56c
commit
f79d7749e7
@ -151,9 +151,9 @@ bool dc_target_set_cursor_attributes(
|
|||||||
const struct dc_cursor_attributes *attributes)
|
const struct dc_cursor_attributes *attributes)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
struct core_target *target = DC_TARGET_TO_CORE(dc_target);
|
struct core_target *target;
|
||||||
struct core_dc *core_dc = DC_TO_CORE(target->ctx->dc);
|
struct core_dc *core_dc;
|
||||||
struct resource_context *res_ctx = &core_dc->current_context->res_ctx;
|
struct resource_context *res_ctx;
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
|
|
||||||
if (NULL == dc_target) {
|
if (NULL == dc_target) {
|
||||||
@ -165,6 +165,10 @@ bool dc_target_set_cursor_attributes(
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
target = DC_TARGET_TO_CORE(dc_target);
|
||||||
|
core_dc = DC_TO_CORE(target->ctx->dc);
|
||||||
|
res_ctx = &core_dc->current_context->res_ctx;
|
||||||
|
|
||||||
for (i = 0; i < dc_target->stream_count; i++) {
|
for (i = 0; i < dc_target->stream_count; i++) {
|
||||||
const struct dc_stream *stream = dc_target->streams[i];
|
const struct dc_stream *stream = dc_target->streams[i];
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user