Commit 84c30d25 authored by Markus Elfring's avatar Markus Elfring Committed by Alex Deucher

drm/amd/display: Return directly after a failed kzalloc() in dc_create()

* Return directly after a call of the function “kzalloc” failed
  at the beginning.

* Delete a label which became unnecessary with this refactoring.
Signed-off-by: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent ae279f69
......@@ -964,8 +964,8 @@ struct dc *dc_create(const struct dc_init_data *init_params)
struct dc *dc = kzalloc(sizeof(*dc), GFP_KERNEL);
unsigned int full_pipe_count;
if (NULL == dc)
goto alloc_fail;
if (!dc)
return NULL;
if (init_params->dce_environment == DCE_ENV_VIRTUAL_HW) {
if (false == dc_construct_ctx(dc, init_params)) {
......@@ -1009,8 +1009,6 @@ struct dc *dc_create(const struct dc_init_data *init_params)
construct_fail:
kfree(dc);
alloc_fail:
return NULL;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment