diff options
author | Kevin Tang <[email protected]> | 2022-01-16 23:55:47 +0800 |
---|---|---|
committer | kevin3.tang <[email protected]> | 2022-02-14 21:53:14 +0800 |
commit | 8668658aebb0a19d877d5a81c004baf716c4aaa6 (patch) | |
tree | adabe90b9875995cabc09cfef651c3f006e0faa9 | |
parent | cecece2ca505dcd47359ae21e3b37ca1f57c08e4 (diff) |
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 <[email protected]>
Signed-off-by: Kevin Tang <[email protected]>
Reviewed-by: Javier Martinez Canillas <[email protected]>
Acked-by: Thomas Zimmermann <[email protected]>
Link: https://lore.kernel.org/all/[email protected]
v1 -> v2:
- Split checking platform_get_resource() return value to a separate patch
- Use dev_warn() instead of removing the warning log
-rw-r--r-- | drivers/gpu/drm/sprd/sprd_drm.c | 2 |
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; } |