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: <1471812743-5095-1-git-send-email-xypron.glpk@gmx.de>
Date:   Sun, 21 Aug 2016 22:52:23 +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>, dri-devel@...ts.freedesktop.org,
        linux-kernel@...r.kernel.org,
        Heinrich Schuchardt <xypron.glpk@....de>
Subject: [PATCH 1/1] drm/radeon: avoid NULL dereference, si_get_vce_clock_voltage

It does not make sense to check if table is NULL
and afterwards to dereference it without
considering the result.

The inconsistency was indicated by cppcheck.
An actual NULL pointer dereference was not observed.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@....de>
---
 drivers/gpu/drm/radeon/si_dpm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/si_dpm.c b/drivers/gpu/drm/radeon/si_dpm.c
index e6abc09..ba2cf12 100644
--- a/drivers/gpu/drm/radeon/si_dpm.c
+++ b/drivers/gpu/drm/radeon/si_dpm.c
@@ -2962,7 +2962,7 @@ static int si_get_vce_clock_voltage(struct radeon_device *rdev,
 		&rdev->pm.dpm.dyn_state.vce_clock_voltage_dependency_table;
 
 	if (((evclk == 0) && (ecclk == 0)) ||
-	    (table && (table->count == 0))) {
+	    table == NULL || table->count == 0) {
 		*voltage = 0;
 		return 0;
 	}
-- 
2.1.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ