summary refs log tree commit diff
path: root/drivers/gpu/drm/sprd
diff options
context:
space:
mode:
authorKevin Tang <kevin3.tang@gmail.com>2022-01-16 23:55:47 +0800
committerkevin3.tang <kevin3.tang@gmail.com>2022-02-14 21:53:14 +0800
commit8668658aebb0a19d877d5a81c004baf716c4aaa6 (patch)
treeadabe90b9875995cabc09cfef651c3f006e0faa9 /drivers/gpu/drm/sprd
parentcecece2ca505dcd47359ae21e3b37ca1f57c08e4 (diff)
downloadlinux-8668658aebb0a19d877d5a81c004baf716c4aaa6.tar.gz
drm/sprd: fix potential NULL dereference
'drm' could be null in sprd_drm_shutdown, and drm_warn maybe dereference
it, remove this warning log.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kevin Tang <kevin3.tang@gmail.com>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://lore.kernel.org/all/20220117084044.9210-1-kevin3.tang@gmail.com

v1 -> v2:
- Split checking platform_get_resource() return value to a separate patch
- Use dev_warn() instead of removing the warning log
Diffstat (limited to 'drivers/gpu/drm/sprd')
-rw-r--r--drivers/gpu/drm/sprd/sprd_drm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/sprd/sprd_drm.c b/drivers/gpu/drm/sprd/sprd_drm.c
index 286edae95189..a60ecdd67d98 100644
--- a/drivers/gpu/drm/sprd/sprd_drm.c
+++ b/drivers/gpu/drm/sprd/sprd_drm.c
@@ -154,7 +154,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;
 	}