summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/display/dc/core/dc.c
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2020-12-19 20:04:33 +0300
committerAlex Deucher <alexander.deucher@amd.com>2020-12-23 23:07:44 +0300
commit84c30d2558f889ca0ebe594bffbc584652384e2c (patch)
treea528811218eaf09313cdd5e881669ef476eeffde /drivers/gpu/drm/amd/display/dc/core/dc.c
parentae279f693c1ce598da0c317a63a0241480f98b92 (diff)
downloadlinux-84c30d2558f889ca0ebe594bffbc584652384e2c.tar.xz
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: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/dc/core/dc.c')
-rw-r--r--drivers/gpu/drm/amd/display/dc/core/dc.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 58eb0d69873a..1f0f2a48879f 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -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;
}