Skip to contentSkip to conversation

drm/sprd: fix potential NULL dereference

PATCH New Kevin Tang 1 participant 1 message Jan 17, 2022

Subsystems (3)
lore
Share & tools
lore

Kevin Tang

author
#0 lore raw

PATCH v2 2/3 drm/sprd: fix potential NULL dereference

'drm' could be null in sprd_drm_shutdown, and drm_warn maybe dereference it, remove this warning log.

v1 -> v2:
- Split checking platform_get_resource() return value to a separate patch
- Use dev_warn() instead of removing the warning log

---
 drivers/gpu/drm/sprd/sprd_drm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/sprd/sprd_drm.c +1 -1
index a077e2d4d..af2be97d5 100644
@@ -155,7 +155,7 @@ static void sprd_drm_shutdown(struct platform_device *pdev)
 	struct drm_device *drm = platform_get_drvdata(pdev);
 
 	if (!drm) {
-		drm_warn(drm, "drm device is not available, no shutdown\n");
+		dev_warn(&pdev->dev, "drm device is not available, no shutdown\n");
 		return;
 	}
 
Signature · 1 line
2.29.0