Re: [PATCH v2 2/2] drm/sun4i: tcon: prevent tcon->panel dereference if null

From: Giulio Benetti
Date: Fri Oct 05 2018 - 17:38:12 EST


Hi,

Il 04/10/2018 21:56, Maxime Ripard ha scritto:
On Wed, Oct 03, 2018 at 04:24:58PM +0200, Giulio Benetti wrote:
If using tcon with VGA,

We don't have support for VGA at the moment. Or are you talking about
using a VGA bridge?

You're right, in general VGA is not the point.
tcon->panel is retrieved by drm_of_find_panel_or_bridge() and panel can be present or not.

tcon->panel will be null(0), this will cause segmentation fault when
trying to dereference tcon->panel->connector.

It's not a segmentation fault, but a null pointer dereference. And
that case will also happen with bridges.

Right.

Going to improve/rewrite commit logs and submit v2 patchset.

Thanks for reviewing.

Best regards
--
Giulio Benetti
CTO

MICRONOVA SRL
Sede: Via A. Niedda 3 - 35010 Vigonza (PD)
Tel. 049/8931563 - Fax 049/8931346
Cod.Fiscale - P.IVA 02663420285
Capitale Sociale â 26.000 i.v.
Iscritta al Reg. Imprese di Padova N. 02663420285
Numero R.E.A. 258642