* [PATCH v1] drm/bridge: anx7625: Don't store unread return value
@ 2021-08-16 11:14 Robert Foss
2021-08-16 15:54 ` Sam Ravnborg
0 siblings, 1 reply; 3+ messages in thread
From: Robert Foss @ 2021-08-16 11:14 UTC (permalink / raw)
To: a.hajda, narmstrong, robert.foss, Laurent.pinchart, jonas,
jernej.skrabec, airlied, daniel, xji, pihsun, tzungbi, sam,
hsinyi, dri-devel, linux-kernel
Cc: kernel test robot
The return value of sp_tx_rst_aux() is stored, but never read.
This happens in the context EDID communication already failing,
which means that this additional failure doesn't necessarily
convey any additional inforamation.
This means that we can safely avoid storing the value.
Fixes: 8bdfc5dae4e3 ("drm/bridge: anx7625: Add anx7625 MIPI DSI/DPI to DP")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Robert Foss <robert.foss@linaro.org>
---
drivers/gpu/drm/bridge/analogix/anx7625.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c
index 14d73fb1dd15b..3471785915c45 100644
--- a/drivers/gpu/drm/bridge/analogix/anx7625.c
+++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
@@ -771,7 +771,7 @@ static int segments_edid_read(struct anx7625_data *ctx,
ret = sp_tx_aux_rd(ctx, 0xf1);
if (ret) {
- ret = sp_tx_rst_aux(ctx);
+ sp_tx_rst_aux(ctx);
DRM_DEV_ERROR(dev, "segment read fail, reset!\n");
} else {
ret = anx7625_reg_block_read(ctx, ctx->i2c.rx_p0_client,
--
2.30.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v1] drm/bridge: anx7625: Don't store unread return value
2021-08-16 11:14 [PATCH v1] drm/bridge: anx7625: Don't store unread return value Robert Foss
@ 2021-08-16 15:54 ` Sam Ravnborg
2021-08-18 16:15 ` Robert Foss
0 siblings, 1 reply; 3+ messages in thread
From: Sam Ravnborg @ 2021-08-16 15:54 UTC (permalink / raw)
To: Robert Foss
Cc: a.hajda, narmstrong, Laurent.pinchart, jonas, jernej.skrabec,
airlied, daniel, xji, pihsun, tzungbi, hsinyi, dri-devel,
linux-kernel, kernel test robot
Hi Robert,
On Mon, Aug 16, 2021 at 01:14:51PM +0200, Robert Foss wrote:
> The return value of sp_tx_rst_aux() is stored, but never read.
> This happens in the context EDID communication already failing,
> which means that this additional failure doesn't necessarily
> convey any additional inforamation.
>
> This means that we can safely avoid storing the value.
>
> Fixes: 8bdfc5dae4e3 ("drm/bridge: anx7625: Add anx7625 MIPI DSI/DPI to DP")
>
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Robert Foss <robert.foss@linaro.org>
> ---
> drivers/gpu/drm/bridge/analogix/anx7625.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c
> index 14d73fb1dd15b..3471785915c45 100644
> --- a/drivers/gpu/drm/bridge/analogix/anx7625.c
> +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
> @@ -771,7 +771,7 @@ static int segments_edid_read(struct anx7625_data *ctx,
> ret = sp_tx_aux_rd(ctx, 0xf1);
>
> if (ret) {
> - ret = sp_tx_rst_aux(ctx);
> + sp_tx_rst_aux(ctx);
> DRM_DEV_ERROR(dev, "segment read fail, reset!\n");
> } else {
> ret = anx7625_reg_block_read(ctx, ctx->i2c.rx_p0_client,
From a quick look this seems to be the wrong fix.
Replace return 0; with return ret; as the last line in this function
looks like the correct fix to me.
With a careful audit that the error handling is OK in said function.
Sam
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v1] drm/bridge: anx7625: Don't store unread return value
2021-08-16 15:54 ` Sam Ravnborg
@ 2021-08-18 16:15 ` Robert Foss
0 siblings, 0 replies; 3+ messages in thread
From: Robert Foss @ 2021-08-18 16:15 UTC (permalink / raw)
To: Sam Ravnborg
Cc: Andrzej Hajda, Neil Armstrong, Laurent Pinchart, Jonas Karlman,
Jernej Skrabec, David Airlie, Daniel Vetter, Xin Ji,
Pi-Hsun Shih, Tzung-Bi Shih, Hsin-Yi Wang, dri-devel,
linux-kernel, kernel test robot
Hey Sam,
> > diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c
> > index 14d73fb1dd15b..3471785915c45 100644
> > --- a/drivers/gpu/drm/bridge/analogix/anx7625.c
> > +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
> > @@ -771,7 +771,7 @@ static int segments_edid_read(struct anx7625_data *ctx,
> > ret = sp_tx_aux_rd(ctx, 0xf1);
> >
> > if (ret) {
> > - ret = sp_tx_rst_aux(ctx);
> > + sp_tx_rst_aux(ctx);
> > DRM_DEV_ERROR(dev, "segment read fail, reset!\n");
> > } else {
> > ret = anx7625_reg_block_read(ctx, ctx->i2c.rx_p0_client,
>
> From a quick look this seems to be the wrong fix.
> Replace return 0; with return ret; as the last line in this function
> looks like the correct fix to me.
> With a careful audit that the error handling is OK in said function.
Thanks for the suggestion, let me have a second look at it.
>
> Sam
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-08-18 16:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-16 11:14 [PATCH v1] drm/bridge: anx7625: Don't store unread return value Robert Foss
2021-08-16 15:54 ` Sam Ravnborg
2021-08-18 16:15 ` Robert Foss
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).