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 for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1471803687-3371-1-git-send-email-xypron.glpk@gmx.de>
Date:   Sun, 21 Aug 2016 20:21:27 +0200
From:   Heinrich Schuchardt <xypron.glpk@....de>
To:     Alex Deucher <alexander.deucher@....com>,
        Christian König <christian.koenig@....com>
Cc:     David Airlie <airlied@...ux.ie>, Rex Zhu <Rex.Zhu@....com>,
        Eric Huang <JinHuiEric.Huang@....com>,
        Jammy Zhou <Jammy.Zhou@....com>,
        Vitaly Prosyak <vitaly.prosyak@....com>,
        David Rokhvarg <David.Rokhvarg@....com>,
        Huang Rui <ray.huang@....com>, dri-devel@...ts.freedesktop.org,
        linux-kernel@...r.kernel.org,
        Heinrich Schuchardt <xypron.glpk@....de>
Subject: [PATCH 1/1] drm/amd/powerplay: avoid NULL pointer dereference

if (a == NULL || a->b == NULL)
leads to a NULL pointer dereference if a == NULL.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@....de>
---
 drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
index abbb658..456a339 100644
--- a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
+++ b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
@@ -162,12 +162,12 @@ static int pp_hw_fini(void *handle)
 	pp_handle = (struct pp_instance *)handle;
 	eventmgr = pp_handle->eventmgr;
 
-	if (eventmgr != NULL || eventmgr->pp_eventmgr_fini != NULL)
+	if (eventmgr != NULL && eventmgr->pp_eventmgr_fini != NULL)
 		eventmgr->pp_eventmgr_fini(eventmgr);
 
 	smumgr = pp_handle->smu_mgr;
 
-	if (smumgr != NULL || smumgr->smumgr_funcs != NULL ||
+	if (smumgr != NULL && smumgr->smumgr_funcs != NULL &&
 		smumgr->smumgr_funcs->smu_fini != NULL)
 		smumgr->smumgr_funcs->smu_fini(smumgr);
 
-- 
2.1.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ