lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1571819543-15676-1-git-send-email-zhong.shiqi@zte.com.cn>
Date:   Wed, 23 Oct 2019 16:32:23 +0800
From:   zhongshiqi <zhong.shiqi@....com.cn>
To:     harry.wentland@....com
Cc:     sunpeng.li@....com, alexander.deucher@....com,
        christian.koenig@....com, David1.Zhou@....com, airlied@...ux.ie,
        daniel@...ll.ch, Bhawanpreet.Lakha@....com, Jun.Lei@....com,
        David.Francis@....com, Dmytro.Laktyushkin@....com,
        anthony.koo@....com, Wenjing.Liu@....com,
        nicholas.kazlauskas@....com, Aidan.Wood@....com,
        Chris.Park@....com, Eric.Yang2@....com,
        amd-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
        linux-kernel@...r.kernel.org, xue.zhihong@....com.cn,
        wang.yi59@....com.cn, cheng.shengyu@....com.cn,
        zhongshiqi <zhong.shiqi@....com.cn>
Subject: [PATCH] dc.c:use kzalloc without test

dc.c:583:null check is needed after using kzalloc function

Signed-off-by: zhongshiqi <zhong.shiqi@....com.cn>
---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 5d1aded..4b8819c 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));
-- 
2.9.5

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ