[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220117084044.9210-1-kevin3.tang@gmail.com>
Date: Mon, 17 Jan 2022 16:40:44 +0800
From: Kevin Tang <kevin3.tang@...il.com>
To: maarten.lankhorst@...ux.intel.com, mripard@...nel.org,
airlied@...ux.ie, daniel@...ll.ch, mark.rutland@....com,
javierm@...hat.com, tzimmermann@...e.de, lukas.bulwahn@...il.com
Cc: zou_wei@...wei.com, kevin3.tang@...il.com, pony1.wu@...il.com,
orsonzhai@...il.com, dan.carpenter@...cle.com,
zhang.lyra@...il.com, linux-kernel@...r.kernel.org,
dri-devel@...ts.freedesktop.org, devicetree@...r.kernel.org
Subject: [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.
Reported-by: Dan Carpenter <dan.carpenter@...cle.com>
Signed-off-by: Kevin Tang <kevin.tang@...soc.com>
Reviewed-by: Javier Martinez Canillas <javierm@...hat.com>
Acked-by: Thomas Zimmermann <tzimmermann@...e.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
Powered by blists - more mailing lists