* [PATCH] drm/bridge: sn65dsi83: Fix an error handling path in sn65dsi83_probe()
@ 2021-12-28 22:37 ` Christophe JAILLET
0 siblings, 0 replies; 4+ messages in thread
From: Christophe JAILLET @ 2021-12-28 22:37 UTC (permalink / raw)
To: andrzej.hajda, narmstrong, robert.foss, Laurent.pinchart, jonas,
jernej.skrabec, airlied, daniel, marex, linus.walleij,
frieder.schrempf
Cc: dri-devel, linux-kernel, kernel-janitors, Christophe JAILLET
sn65dsi83_parse_dt() takes a reference on 'ctx->host_node' that must be
released in the error handling path of the probe.
This is only done in the remove function up to now.
Fixes: ceb515ba29ba ("drm/bridge: ti-sn65dsi83: Add TI SN65DSI83 and SN65DSI84 driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
drivers/gpu/drm/bridge/ti-sn65dsi83.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi83.c b/drivers/gpu/drm/bridge/ti-sn65dsi83.c
index 945f08de45f1..6edea9f8f8c4 100644
--- a/drivers/gpu/drm/bridge/ti-sn65dsi83.c
+++ b/drivers/gpu/drm/bridge/ti-sn65dsi83.c
@@ -673,8 +673,10 @@ static int sn65dsi83_probe(struct i2c_client *client,
return ret;
ctx->regmap = devm_regmap_init_i2c(client, &sn65dsi83_regmap_config);
- if (IS_ERR(ctx->regmap))
- return PTR_ERR(ctx->regmap);
+ if (IS_ERR(ctx->regmap)) {
+ ret = PTR_ERR(ctx->regmap);
+ goto err_put_node;
+ }
dev_set_drvdata(dev, ctx);
i2c_set_clientdata(client, ctx);
@@ -691,6 +693,8 @@ static int sn65dsi83_probe(struct i2c_client *client,
err_remove_bridge:
drm_bridge_remove(&ctx->bridge);
+err_put_node:
+ of_node_put(ctx->host_node);
return ret;
}
--
2.32.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] drm/bridge: sn65dsi83: Fix an error handling path in sn65dsi83_probe()
@ 2021-12-28 22:37 ` Christophe JAILLET
0 siblings, 0 replies; 4+ messages in thread
From: Christophe JAILLET @ 2021-12-28 22:37 UTC (permalink / raw)
To: andrzej.hajda, narmstrong, robert.foss, Laurent.pinchart, jonas,
jernej.skrabec, airlied, daniel, marex, linus.walleij,
frieder.schrempf
Cc: Christophe JAILLET, kernel-janitors, linux-kernel, dri-devel
sn65dsi83_parse_dt() takes a reference on 'ctx->host_node' that must be
released in the error handling path of the probe.
This is only done in the remove function up to now.
Fixes: ceb515ba29ba ("drm/bridge: ti-sn65dsi83: Add TI SN65DSI83 and SN65DSI84 driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
drivers/gpu/drm/bridge/ti-sn65dsi83.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi83.c b/drivers/gpu/drm/bridge/ti-sn65dsi83.c
index 945f08de45f1..6edea9f8f8c4 100644
--- a/drivers/gpu/drm/bridge/ti-sn65dsi83.c
+++ b/drivers/gpu/drm/bridge/ti-sn65dsi83.c
@@ -673,8 +673,10 @@ static int sn65dsi83_probe(struct i2c_client *client,
return ret;
ctx->regmap = devm_regmap_init_i2c(client, &sn65dsi83_regmap_config);
- if (IS_ERR(ctx->regmap))
- return PTR_ERR(ctx->regmap);
+ if (IS_ERR(ctx->regmap)) {
+ ret = PTR_ERR(ctx->regmap);
+ goto err_put_node;
+ }
dev_set_drvdata(dev, ctx);
i2c_set_clientdata(client, ctx);
@@ -691,6 +693,8 @@ static int sn65dsi83_probe(struct i2c_client *client,
err_remove_bridge:
drm_bridge_remove(&ctx->bridge);
+err_put_node:
+ of_node_put(ctx->host_node);
return ret;
}
--
2.32.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/bridge: sn65dsi83: Fix an error handling path in sn65dsi83_probe()
2021-12-28 22:37 ` Christophe JAILLET
@ 2021-12-29 6:23 ` Laurent Pinchart
-1 siblings, 0 replies; 4+ messages in thread
From: Laurent Pinchart @ 2021-12-29 6:23 UTC (permalink / raw)
To: Christophe JAILLET
Cc: andrzej.hajda, narmstrong, robert.foss, jonas, jernej.skrabec,
airlied, daniel, marex, linus.walleij, frieder.schrempf,
dri-devel, linux-kernel, kernel-janitors
Hi Christophe,
Thank you for the patch.
On Tue, Dec 28, 2021 at 11:37:25PM +0100, Christophe JAILLET wrote:
> sn65dsi83_parse_dt() takes a reference on 'ctx->host_node' that must be
> released in the error handling path of the probe.
> This is only done in the remove function up to now.
>
> Fixes: ceb515ba29ba ("drm/bridge: ti-sn65dsi83: Add TI SN65DSI83 and SN65DSI84 driver")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> drivers/gpu/drm/bridge/ti-sn65dsi83.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi83.c b/drivers/gpu/drm/bridge/ti-sn65dsi83.c
> index 945f08de45f1..6edea9f8f8c4 100644
> --- a/drivers/gpu/drm/bridge/ti-sn65dsi83.c
> +++ b/drivers/gpu/drm/bridge/ti-sn65dsi83.c
> @@ -673,8 +673,10 @@ static int sn65dsi83_probe(struct i2c_client *client,
> return ret;
>
> ctx->regmap = devm_regmap_init_i2c(client, &sn65dsi83_regmap_config);
> - if (IS_ERR(ctx->regmap))
> - return PTR_ERR(ctx->regmap);
> + if (IS_ERR(ctx->regmap)) {
> + ret = PTR_ERR(ctx->regmap);
> + goto err_put_node;
> + }
There's another similar issue if sn65dsi83_parse_dt() fails. Would you
mind fixing them all in the same patch ?
>
> dev_set_drvdata(dev, ctx);
> i2c_set_clientdata(client, ctx);
> @@ -691,6 +693,8 @@ static int sn65dsi83_probe(struct i2c_client *client,
>
> err_remove_bridge:
> drm_bridge_remove(&ctx->bridge);
> +err_put_node:
> + of_node_put(ctx->host_node);
> return ret;
> }
>
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/bridge: sn65dsi83: Fix an error handling path in sn65dsi83_probe()
@ 2021-12-29 6:23 ` Laurent Pinchart
0 siblings, 0 replies; 4+ messages in thread
From: Laurent Pinchart @ 2021-12-29 6:23 UTC (permalink / raw)
To: Christophe JAILLET
Cc: marex, dri-devel, jonas, airlied, narmstrong, kernel-janitors,
linux-kernel, jernej.skrabec, frieder.schrempf, robert.foss,
andrzej.hajda
Hi Christophe,
Thank you for the patch.
On Tue, Dec 28, 2021 at 11:37:25PM +0100, Christophe JAILLET wrote:
> sn65dsi83_parse_dt() takes a reference on 'ctx->host_node' that must be
> released in the error handling path of the probe.
> This is only done in the remove function up to now.
>
> Fixes: ceb515ba29ba ("drm/bridge: ti-sn65dsi83: Add TI SN65DSI83 and SN65DSI84 driver")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> drivers/gpu/drm/bridge/ti-sn65dsi83.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi83.c b/drivers/gpu/drm/bridge/ti-sn65dsi83.c
> index 945f08de45f1..6edea9f8f8c4 100644
> --- a/drivers/gpu/drm/bridge/ti-sn65dsi83.c
> +++ b/drivers/gpu/drm/bridge/ti-sn65dsi83.c
> @@ -673,8 +673,10 @@ static int sn65dsi83_probe(struct i2c_client *client,
> return ret;
>
> ctx->regmap = devm_regmap_init_i2c(client, &sn65dsi83_regmap_config);
> - if (IS_ERR(ctx->regmap))
> - return PTR_ERR(ctx->regmap);
> + if (IS_ERR(ctx->regmap)) {
> + ret = PTR_ERR(ctx->regmap);
> + goto err_put_node;
> + }
There's another similar issue if sn65dsi83_parse_dt() fails. Would you
mind fixing them all in the same patch ?
>
> dev_set_drvdata(dev, ctx);
> i2c_set_clientdata(client, ctx);
> @@ -691,6 +693,8 @@ static int sn65dsi83_probe(struct i2c_client *client,
>
> err_remove_bridge:
> drm_bridge_remove(&ctx->bridge);
> +err_put_node:
> + of_node_put(ctx->host_node);
> return ret;
> }
>
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-12-29 6:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-28 22:37 [PATCH] drm/bridge: sn65dsi83: Fix an error handling path in sn65dsi83_probe() Christophe JAILLET
2021-12-28 22:37 ` Christophe JAILLET
2021-12-29 6:23 ` Laurent Pinchart
2021-12-29 6:23 ` Laurent Pinchart
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.