DragonFlyBSD Kernel Audit
DF-1433 / fix.diff
← back to finding ↓ download raw
diff --git a/sys/dev/drm/radeon/radeon_device.c b/sys/dev/drm/radeon/radeon_device.c
--- a/sys/dev/drm/radeon/radeon_device.c
+++ b/sys/dev/drm/radeon/radeon_device.c
@@ -485,7 +485,9 @@
 	}
 
 	/* clear wb memory */
-	memset(*(void **)wb_ptr, 0, RADEON_GPU_PAGE_SIZE);
+	if (rdev->wb.wb == NULL)
+		return -EINVAL;
+	memset((void *)rdev->wb.wb, 0, RADEON_GPU_PAGE_SIZE);
 	/* disable event_write fences */
 	rdev->wb.use_event = false;
 	/* disabled via module param */