Skip to content

Commit d10cf6d

Browse files
committed
Merge tag 'drm-misc-fixes-2018-11-07' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes
- sun4i: tcon->panel NULL deref protections (Giulio) Cc: Giulio Benetti <giulio.benetti@micronovasrl.com> Signed-off-by: Dave Airlie <airlied@redhat.com> From: Sean Paul <sean@poorly.run> Link: https://patchwork.freedesktop.org/patch/msgid/20181107205051.GA27823@art_vandelay
2 parents 7d588f9 + a893976 commit d10cf6d

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

drivers/gpu/drm/sun4i/sun4i_lvds.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ static void sun4i_lvds_encoder_enable(struct drm_encoder *encoder)
7575

7676
DRM_DEBUG_DRIVER("Enabling LVDS output\n");
7777

78-
if (!IS_ERR(tcon->panel)) {
78+
if (tcon->panel) {
7979
drm_panel_prepare(tcon->panel);
8080
drm_panel_enable(tcon->panel);
8181
}
@@ -88,7 +88,7 @@ static void sun4i_lvds_encoder_disable(struct drm_encoder *encoder)
8888

8989
DRM_DEBUG_DRIVER("Disabling LVDS output\n");
9090

91-
if (!IS_ERR(tcon->panel)) {
91+
if (tcon->panel) {
9292
drm_panel_disable(tcon->panel);
9393
drm_panel_unprepare(tcon->panel);
9494
}

drivers/gpu/drm/sun4i/sun4i_rgb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ static void sun4i_rgb_encoder_enable(struct drm_encoder *encoder)
135135

136136
DRM_DEBUG_DRIVER("Enabling RGB output\n");
137137

138-
if (!IS_ERR(tcon->panel)) {
138+
if (tcon->panel) {
139139
drm_panel_prepare(tcon->panel);
140140
drm_panel_enable(tcon->panel);
141141
}
@@ -148,7 +148,7 @@ static void sun4i_rgb_encoder_disable(struct drm_encoder *encoder)
148148

149149
DRM_DEBUG_DRIVER("Disabling RGB output\n");
150150

151-
if (!IS_ERR(tcon->panel)) {
151+
if (tcon->panel) {
152152
drm_panel_disable(tcon->panel);
153153
drm_panel_unprepare(tcon->panel);
154154
}

drivers/gpu/drm/sun4i/sun4i_tcon.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,8 @@ static void sun4i_tcon0_mode_set_rgb(struct sun4i_tcon *tcon,
491491
sun4i_tcon0_mode_set_common(tcon, mode);
492492

493493
/* Set dithering if needed */
494-
sun4i_tcon0_mode_set_dithering(tcon, tcon->panel->connector);
494+
if (tcon->panel)
495+
sun4i_tcon0_mode_set_dithering(tcon, tcon->panel->connector);
495496

496497
/* Adjust clock delay */
497498
clk_delay = sun4i_tcon_get_clk_delay(mode, 0);
@@ -555,7 +556,7 @@ static void sun4i_tcon0_mode_set_rgb(struct sun4i_tcon *tcon,
555556
* Following code is a way to avoid quirks all around TCON
556557
* and DOTCLOCK drivers.
557558
*/
558-
if (!IS_ERR(tcon->panel)) {
559+
if (tcon->panel) {
559560
struct drm_panel *panel = tcon->panel;
560561
struct drm_connector *connector = panel->connector;
561562
struct drm_display_info display_info = connector->display_info;

0 commit comments

Comments
 (0)