1
0
Fork 0
alistair23-linux/drivers/gpu/drm/mcde
Stephan Gerhold d8fe0af636 drm/mcde: dsi: Fix invalid pointer dereference if panel cannot be found
[ Upstream commit c131280c03 ]

The "panel" pointer is not reset to NULL if of_drm_find_panel()
returns an error. Therefore we later assume that a panel was found,
and try to dereference the error pointer, resulting in:

    mcde-dsi a0351000.dsi: failed to find panel try bridge (4294966779)
    Unable to handle kernel paging request at virtual address fffffe03
    PC is at drm_panel_bridge_add.part.0+0x10/0x5c
    LR is at mcde_dsi_bind+0x120/0x464
    ...

Reset "panel" to NULL to avoid this problem.
Also change the format string of the error to %ld to print
the negative errors correctly. The crash above then becomes:

    mcde-dsi a0351000.dsi: failed to find panel try bridge (-517)
    mcde-dsi a0351000.dsi: no panel or bridge
    ...

Fixes: 5fc537bfd0 ("drm/mcde: Add new driver for ST-Ericsson MCDE")
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20191118130252.170324-1-stephan@gerhold.net
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-01-09 10:19:41 +01:00
..
Kconfig
Makefile
mcde_display.c drm/mcde: Fix an uninitialized variable 2019-06-13 11:55:23 +02:00
mcde_display_regs.h
mcde_drm.h
mcde_drv.c drm/mcde: Fix an error handling path in 'mcde_probe()' 2019-12-13 08:43:29 +01:00
mcde_dsi.c drm/mcde: dsi: Fix invalid pointer dereference if panel cannot be found 2020-01-09 10:19:41 +01:00
mcde_dsi_regs.h