Skip to content

Commit 2bc5ff0

Browse files
committed
drm/omap: fix NULL deref crash with SDI displays
Fix a NULL deref bug introduced in commit 24aac60 ("drm: omapdrm: sdi: Allocate the sdi private data structure dynamically"). Signed-off-by: Tomi Valkeinen <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Fixes: 24aac60 ("drm: omapdrm: sdi: Allocate the sdi private data structure dynamically") Reported-by: Tony Lindgren <[email protected]> Tested-by: Tony Lindgren <[email protected]> Reviewed-by: Benoit Parrot <[email protected]>
1 parent bdcc02c commit 2bc5ff0

File tree

1 file changed

+4
-1
lines changed
  • drivers/gpu/drm/omapdrm/dss

1 file changed

+4
-1
lines changed

drivers/gpu/drm/omapdrm/dss/sdi.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ static int sdi_calc_clock_div(struct sdi_device *sdi, unsigned long pclk,
8282
struct dispc_clock_info *dispc_cinfo)
8383
{
8484
int i;
85-
struct sdi_clk_calc_ctx ctx = { .sdi = sdi };
85+
struct sdi_clk_calc_ctx ctx;
8686

8787
/*
8888
* DSS fclk gives us very few possibilities, so finding a good pixel
@@ -95,6 +95,9 @@ static int sdi_calc_clock_div(struct sdi_device *sdi, unsigned long pclk,
9595
bool ok;
9696

9797
memset(&ctx, 0, sizeof(ctx));
98+
99+
ctx.sdi = sdi;
100+
98101
if (pclk > 1000 * i * i * i)
99102
ctx.pck_min = max(pclk - 1000 * i * i * i, 0lu);
100103
else

0 commit comments

Comments
 (0)