Skip to content

Commit

Permalink
drm/sprd: fix potential NULL dereference
Browse files Browse the repository at this point in the history
'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
  • Loading branch information
Kevin Tang committed Feb 14, 2022
1 parent cecece2 commit 8668658
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/sprd/sprd_drm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 8668658

Please sign in to comment.