diff options
author | David Lechner <david@lechnology.com> | 2017-08-02 13:00:13 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2017-08-03 12:12:15 +0200 |
commit | 27a061fb161b684b1204eedb82f6f84ecc4a1485 (patch) | |
tree | b6b382d485d94d1694beae39a0a7228368863925 /drivers/gpu | |
parent | db1689aa61bd1efb5ce9b896e7aa860a85b7f1b6 (diff) | |
download | op-kernel-dev-27a061fb161b684b1204eedb82f6f84ecc4a1485.zip op-kernel-dev-27a061fb161b684b1204eedb82f6f84ecc4a1485.tar.gz |
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: David Lechner <david@lechnology.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/1501696813-8807-1-git-send-email-david@lechnology.com
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/drm_fb_helper.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 4b968f5..b2a01d1 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -2410,9 +2410,9 @@ static void drm_setup_crtcs(struct drm_fb_helper *fb_helper, struct drm_display_mode *mode = modes[i]; struct drm_fb_helper_crtc *fb_crtc = crtcs[i]; struct drm_fb_offset *offset = &offsets[i]; - struct drm_mode_set *modeset = &fb_crtc->mode_set; if (mode && fb_crtc) { + struct drm_mode_set *modeset = &fb_crtc->mode_set; struct drm_connector *connector = fb_helper->connector_info[i]->connector; |