All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/msm/dpu: fix error check return value of irq_of_parse_and_map()
@ 2022-04-25  9:09 ` cgel.zte
  0 siblings, 0 replies; 6+ messages in thread
From: cgel.zte @ 2022-04-25  9:09 UTC (permalink / raw)
  To: robdclark, sean
  Cc: architt, linux-kernel, ryadav, airlied, linux-arm-msm, Lv Ruyi,
	quic_abhinavk, dri-devel, bjorn.andersson, tiny.windzz,
	angelogioacchino.delregno, dmitry.baryshkov, jsanka, swboyd,
	freedreno, Zeal Robot, skolluku

From: Lv Ruyi <lv.ruyi@zte.com.cn>

The irq_of_parse_and_map() function returns 0 on failure, and does not
return a negative value anyhow, so never enter this conditional branch.

Fixes: 25fdd5933e4c ("drm/msm: Add SDM845 DPU support")
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
index e29796c4f27b..36eeeae7fe45 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
@@ -1187,9 +1187,9 @@ struct msm_kms *dpu_kms_init(struct drm_device *dev)
 	dpu_kms = to_dpu_kms(priv->kms);
 
 	irq = irq_of_parse_and_map(dpu_kms->pdev->dev.of_node, 0);
-	if (irq < 0) {
-		DPU_ERROR("failed to get irq: %d\n", irq);
-		return ERR_PTR(irq);
+	if (!irq) {
+		DPU_ERROR("failed to get irq\n");
+		return ERR_PTR(-EINVAL);
 	}
 	dpu_kms->base.irq = irq;
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-04-25 21:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-25  9:09 [PATCH] drm/msm/dpu: fix error check return value of irq_of_parse_and_map() cgel.zte
2022-04-25  9:09 ` cgel.zte
2022-04-25 20:10 ` Stephen Boyd
2022-04-25 20:10   ` Stephen Boyd
2022-04-25 21:08   ` Dmitry Baryshkov
2022-04-25 21:08     ` Dmitry Baryshkov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.