[bug report] drm/sprd: add Unisoc's drm kms master
Dan Carpenter
dan.carpenter at oracle.com
Wed Dec 15 11:32:04 UTC 2021
Hello Kevin Tang,
This is a semi-automatic email about new static checker warnings.
The patch 43531edd53f0: "drm/sprd: add Unisoc's drm kms master" from
Dec 7, 2021, leads to the following Smatch complaint:
drivers/gpu/drm/sprd/sprd_drm.c:158 sprd_drm_shutdown()
error: we previously assumed 'drm' could be null (see line 157)
drivers/gpu/drm/sprd/sprd_drm.c
153 static void sprd_drm_shutdown(struct platform_device *pdev)
154 {
155 struct drm_device *drm = platform_get_drvdata(pdev);
156
157 if (!drm) {
^^^^
"drm" is NULL
158 drm_warn(drm, "drm device is not available, no shutdown\n");
^^^
This dereferences it. drm is set in bind().
159 return;
160 }
161
162 drm_atomic_helper_shutdown(drm);
163 }
regards,
dan carpenter
More information about the dri-devel
mailing list