Skip to contentSkip to conversation

drm/radeon/dpm: fix uninitialized read from stack in kv_dpm_late_enable

PATCH Applied Dave Jones 2 participants 2 messages Jan 31, 2014

Subsystems (2)
lore
Share & tools
lore

Dave Jones

author
#0 lore raw

If we take the false branch of the if quoted in the diff below, we end up doing a return ret, without ever having initialized it.

Picked up by coverity.

drivers/gpu/drm/radeon/kv_dpm.c +1 -1
index b6e01d5d2cce..351db361239d 100644
@@ -1223,7 +1223,7 @@ int kv_dpm_enable(struct radeon_device *rdev)
 
 int kv_dpm_late_enable(struct radeon_device *rdev)
 {
-	int ret;
+	int ret = 0;
 
 	if (rdev->irq.installed &&
 	    r600_is_internal_thermal_sensor(rdev->pm.int_thermal_type)) {
maintainer Applied
#1 lore raw
Quoted 8 lines

-----Original Message-----
From: Dave Jones [mailto:[email protected]]
Sent: Thursday, January 30, 2014 9:18 PM
To: Linux Kernel Mailing List
Cc: Deucher, Alexander
Subject: drm/radeon/dpm: fix uninitialized read from stack in kv_dpm_late_enable

Quoted 6 lines

If we take the false branch of the if quoted in the diff below, we end up doing a return ret, without ever having initialized it.

Picked up by coverity.

Applied. Thanks!

Alex

Quoted 15 lines
drivers/gpu/drm/radeon/kv_dpm.c +1 -1
index b6e01d5d2cce..351db361239d 100644
@@ -1223,7 +1223,7 @@ int kv_dpm_enable(struct radeon_device *rdev)
 
 int kv_dpm_late_enable(struct radeon_device *rdev)
 {
-	int ret;
+	int ret = 0;
 
 	if (rdev->irq.installed &&
 	    r600_is_internal_thermal_sensor(rdev->pm.int_thermal_type)) {