Skip to contentSkip to conversation

drm/mediatek: fix uninitialized symbol

PATCH Superseded Nancy.Lin 2 participants 3 messages Apr 20, 2023 – Apr 21, 2023

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Nancy.Lin

author
#0 lore raw

PATCH 1/1 drm/mediatek: fix uninitialized symbol

fix Smatch static checker warning
- uninitialized symbol comp_pdev in mtk_ddp_comp_init.

---
 drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c +4 -1
index f114da4d36a9..e987ac4481bc 100644
@@ -546,7 +546,7 @@ unsigned int mtk_drm_find_possible_crtc_by_comp(struct drm_device *drm,
 int mtk_ddp_comp_init(struct device_node *node, struct mtk_ddp_comp *comp,
 		      unsigned int comp_id)
 {
-	struct platform_device *comp_pdev;
+	struct platform_device *comp_pdev = NULL;
 	enum mtk_ddp_comp_type type;
 	struct mtk_ddp_comp_dev *priv;
 #if IS_REACHABLE(CONFIG_MTK_CMDQ)
@@ -588,6 +588,9 @@ int mtk_ddp_comp_init(struct device_node *node, struct mtk_ddp_comp *comp,
 	    type == MTK_DSI)
 		return 0;
 
+	if (!comp_pdev)
+		return -EPROBE_DEFER;
+
 	priv = devm_kzalloc(comp->dev, sizeof(*priv), GFP_KERNEL);
 	if (!priv)
 		return -ENOMEM;
Signature · 1 line
2.18.0
#1 lore raw

Il 20/04/23 12:51, Nancy.Lin ha scritto:

Quoted 4 lines

fix Smatch static checker warning
- uninitialized symbol comp_pdev in mtk_ddp_comp_init.

I agree with this commit, but please add a Fixes tag.

Thanks,
Angelo

#2 lore raw

Hi Angelo,

Quoted 8 lines · AngeloGioacchino Del Regno

External email : Please do not click links or open attachments until you have verified the sender or the content.

Il 20/04/23 12:51, Nancy.Lin ha scritto:

Quoted 3 lines

fix Smatch static checker warning
- uninitialized symbol comp_pdev in mtk_ddp_comp_init.

Quoted 6 lines
Quoted 1 line

I agree with this commit, but please add a Fixes tag.

Thanks,
Angelo

Thanks for the review. I will resend it with Fixes tag.

Regards,
Nancy