diff options
author | zhongshiqi <zhong.shiqi@zte.com.cn> | 2019-10-23 16:32:23 +0800 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2019-10-30 11:56:16 -0400 |
commit | 364593f3ee5fdefc6efd89475e1804c928b4e6ba (patch) | |
tree | e3b9c58c1acfa36848718d5e283fa3195da25727 /drivers/gpu | |
parent | 385857adb8154563840e5b0f200254126618f464 (diff) | |
download | linux-stable-364593f3ee5fdefc6efd89475e1804c928b4e6ba.tar.gz linux-stable-364593f3ee5fdefc6efd89475e1804c928b4e6ba.tar.bz2 linux-stable-364593f3ee5fdefc6efd89475e1804c928b4e6ba.zip |
dc.c:use kzalloc without test
dc.c:583:null check is needed after using kzalloc function
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: zhongshiqi <zhong.shiqi@zte.com.cn>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/core/dc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c index 5d1adeda4d90..4b8819c27fcd 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc.c @@ -580,6 +580,10 @@ static bool construct(struct dc *dc, #ifdef CONFIG_DRM_AMD_DC_DCN2_0 // Allocate memory for the vm_helper dc->vm_helper = kzalloc(sizeof(struct vm_helper), GFP_KERNEL); + if (!dc->vm_helper) { + dm_error("%s: failed to create dc->vm_helper\n", __func__); + goto fail; + } #endif memcpy(&dc->bb_overrides, &init_params->bb_overrides, sizeof(dc->bb_overrides)); |