Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/dist/drm Avoid null pointer dereferenc...



details:   https://anonhg.NetBSD.org/src/rev/d217ef2def75
branches:  trunk
changeset: 846210:d217ef2def75
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Tue Nov 05 04:09:51 2019 +0000

description:
Avoid null pointer dereference found by kUBSan with "member access within
null pointer of type 'struct drm_fb_helper_crtc'".

diffstat:

 sys/external/bsd/drm2/dist/drm/drm_fb_helper.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (29 lines):

diff -r fc403e16b100 -r d217ef2def75 sys/external/bsd/drm2/dist/drm/drm_fb_helper.c
--- a/sys/external/bsd/drm2/dist/drm/drm_fb_helper.c    Mon Nov 04 15:12:10 2019 +0000
+++ b/sys/external/bsd/drm2/dist/drm/drm_fb_helper.c    Tue Nov 05 04:09:51 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: drm_fb_helper.c,v 1.12 2018/08/27 13:37:21 riastradh Exp $     */
+/*     $NetBSD: drm_fb_helper.c,v 1.13 2019/11/05 04:09:51 msaitoh Exp $       */
 
 /*
  * Copyright (c) 2006-2009 Red Hat Inc.
@@ -30,7 +30,7 @@
  *      Jesse Barnes <jesse.barnes%intel.com@localhost>
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drm_fb_helper.c,v 1.12 2018/08/27 13:37:21 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_fb_helper.c,v 1.13 2019/11/05 04:09:51 msaitoh Exp $");
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
@@ -2086,9 +2086,9 @@
                struct drm_display_mode *mode = modes[i];
                struct drm_fb_helper_crtc *fb_crtc = crtcs[i];
                struct drm_fb_offset *offset = &offsets[i];
-               modeset = &fb_crtc->mode_set;
 
                if (mode && fb_crtc) {
+                       modeset = &fb_crtc->mode_set;
                        DRM_DEBUG_KMS("desired mode %s set on crtc %d (%d,%d)\n",
                                      mode->name, fb_crtc->mode_set.crtc->base.id, offset->x, offset->y);
                        fb_crtc->desired_mode = mode;



Home | Main Index | Thread Index | Old Index