Skip to contentSkip to conversation

drm: remove node from list before freeing the node

PATCH In review Yang Li 2 participants 2 messages Dec 3, 2021

Subsystems (3)
lore
Share & tools
lore

Yang Li

author
#0 lore raw

PATCH 1/1 drm: remove node from list before freeing the node

fix the following smatch warning:
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c:1675 dpu_plane_init() warn:
'&pdpu->mplane_list' not removed from list

---
 drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +1 -0
index ca190d9..aad238b 100644
@@ -1672,6 +1672,7 @@ struct drm_plane *dpu_plane_init(struct drm_device *dev,
 	if (pdpu && pdpu->pipe_hw)
 		dpu_hw_sspp_destroy(pdpu->pipe_hw);
 clean_plane:
+	list_del(&pdpu->mplane_list);
 	kfree(pdpu);
 	return ERR_PTR(ret);
 }
Signature · 1 line
1.8.3.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Yang Li

fix the following smatch warning:
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c:1675 dpu_plane_init() warn:
'&pdpu->mplane_list' not removed from list

Quoted 17 lines
---
  drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 1 +
  1 file changed, 1 insertion(+)
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +1 -0
index ca190d9..aad238b 100644
@@ -1672,6 +1672,7 @@ struct drm_plane *dpu_plane_init(struct drm_device *dev,
  	if (pdpu && pdpu->pipe_hw)
  		dpu_hw_sspp_destroy(pdpu->pipe_hw);
  clean_plane:
+	list_del(&pdpu->mplane_list);
  	kfree(pdpu);
  	return ERR_PTR(ret);
  }
Signature · 2 lines
With best wishes
Dmitry