Commit 27a061fb authored by David Lechner's avatar David Lechner Committed by Daniel Vetter

drm/fb: Fix pointer dereference before null check.

fb_crtc is used before a null check, so move the use after the null check.

This was just identified by inspection. I haven't actually observed a crash
here, so it is possible that the null check could be unnecessary.
Signed-off-by: default avatarDavid Lechner <david@lechnology.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/1501696813-8807-1-git-send-email-david@lechnology.com
parent db1689aa
...@@ -2410,9 +2410,9 @@ static void drm_setup_crtcs(struct drm_fb_helper *fb_helper, ...@@ -2410,9 +2410,9 @@ static void drm_setup_crtcs(struct drm_fb_helper *fb_helper,
struct drm_display_mode *mode = modes[i]; struct drm_display_mode *mode = modes[i];
struct drm_fb_helper_crtc *fb_crtc = crtcs[i]; struct drm_fb_helper_crtc *fb_crtc = crtcs[i];
struct drm_fb_offset *offset = &offsets[i]; struct drm_fb_offset *offset = &offsets[i];
struct drm_mode_set *modeset = &fb_crtc->mode_set;
if (mode && fb_crtc) { if (mode && fb_crtc) {
struct drm_mode_set *modeset = &fb_crtc->mode_set;
struct drm_connector *connector = struct drm_connector *connector =
fb_helper->connector_info[i]->connector; fb_helper->connector_info[i]->connector;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment