mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 2/3] drm/sprd: fix potential NULL dereference
@ 2022-01-17  8:40 Kevin Tang
  0 siblings, 0 replies; only message in thread
From: Kevin Tang @ 2022-01-17  8:40 UTC (permalink / raw)
  To: maarten.lankhorst, mripard, airlied, daniel, mark.rutland,
	javierm, tzimmermann, lukas.bulwahn
  Cc: zou_wei, kevin3.tang, pony1.wu, orsonzhai, dan.carpenter,
	zhang.lyra, linux-kernel, dri-devel, devicetree

'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 <kevin.tang@unisoc.com>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>

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(-)

diff --git a/drivers/gpu/drm/sprd/sprd_drm.c b/drivers/gpu/drm/sprd/sprd_drm.c
index a077e2d4d..af2be97d5 100644
--- a/drivers/gpu/drm/sprd/sprd_drm.c
+++ b/drivers/gpu/drm/sprd/sprd_drm.c
@@ -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;
 	}
 
-- 
2.29.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-01-17  8:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-17  8:40 [PATCH v2 2/3] drm/sprd: fix potential NULL dereference Kevin Tang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome