linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/bridge: anx7625: Fix overflow issue on reading EDID
@ 2022-02-09  5:53 Pin-Yen Lin
  2022-02-09 17:28 ` Jernej Škrabec
  0 siblings, 1 reply; 2+ messages in thread
From: Pin-Yen Lin @ 2022-02-09  5:53 UTC (permalink / raw)
  To: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, David Airlie, Daniel Vetter
  Cc: Pin-Yen Lin, Hsin-Yi Wang, Maxime Ripard, Pi-Hsun Shih,
	Sam Ravnborg, Tzung-Bi Shih, Xin Ji, dri-devel, linux-kernel

The length of EDID block can be longer than 256 bytes, so we should use
`int` instead of `u8` for the `edid_pos` variable.

Signed-off-by: Pin-Yen Lin <treapking@chromium.org>
---

 drivers/gpu/drm/bridge/analogix/anx7625.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c
index 2346dbcc505f..e596cacce9e3 100644
--- a/drivers/gpu/drm/bridge/analogix/anx7625.c
+++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
@@ -846,7 +846,8 @@ static int segments_edid_read(struct anx7625_data *ctx,
 static int sp_tx_edid_read(struct anx7625_data *ctx,
 			   u8 *pedid_blocks_buf)
 {
-	u8 offset, edid_pos;
+	u8 offset;
+	int edid_pos;
 	int count, blocks_num;
 	u8 pblock_buf[MAX_DPCD_BUFFER_SIZE];
 	u8 i, j;
-- 
2.35.0.263.gb82422642f-goog


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

* Re: [PATCH] drm/bridge: anx7625: Fix overflow issue on reading EDID
  2022-02-09  5:53 [PATCH] drm/bridge: anx7625: Fix overflow issue on reading EDID Pin-Yen Lin
@ 2022-02-09 17:28 ` Jernej Škrabec
  0 siblings, 0 replies; 2+ messages in thread
From: Jernej Škrabec @ 2022-02-09 17:28 UTC (permalink / raw)
  To: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, David Airlie, Daniel Vetter, Pin-Yen Lin
  Cc: Pin-Yen Lin, Hsin-Yi Wang, Maxime Ripard, Pi-Hsun Shih,
	Sam Ravnborg, Tzung-Bi Shih, Xin Ji, dri-devel, linux-kernel

Hi!

Dne sreda, 09. februar 2022 ob 06:53:27 CET je Pin-Yen Lin napisal(a):
> The length of EDID block can be longer than 256 bytes, so we should use
> `int` instead of `u8` for the `edid_pos` variable.
> 
> Signed-off-by: Pin-Yen Lin <treapking@chromium.org>

Please add "Fixes" tag. With that:
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>

Best regards,
Jernej



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

end of thread, other threads:[~2022-02-09 17:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-09  5:53 [PATCH] drm/bridge: anx7625: Fix overflow issue on reading EDID Pin-Yen Lin
2022-02-09 17:28 ` Jernej Škrabec

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).