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 drm: Avoid null pointer deref...



details:   https://anonhg.NetBSD.org/src/rev/c629d437cde9
branches:  trunk
changeset: 1028820:c629d437cde9
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 12:08:18 2021 +0000

description:
drm: Avoid null pointer deref for drivers with atomic modeset.

diffstat:

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

diffs (35 lines):

diff -r 167432493938 -r c629d437cde9 sys/external/bsd/drm2/dist/drm/drm_fb_helper.c
--- a/sys/external/bsd/drm2/dist/drm/drm_fb_helper.c    Sun Dec 19 12:08:10 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/drm_fb_helper.c    Sun Dec 19 12:08:18 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: drm_fb_helper.c,v 1.25 2021/12/19 12:04:59 riastradh Exp $     */
+/*     $NetBSD: drm_fb_helper.c,v 1.26 2021/12/19 12:08:18 riastradh 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.25 2021/12/19 12:04:59 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_fb_helper.c,v 1.26 2021/12/19 12:08:18 riastradh Exp $");
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
@@ -175,13 +175,13 @@
                        if (!mode_set->crtc->enabled)
                                continue;
 
+                       if (drm_drv_uses_atomic_modeset(mode_set->crtc->dev))
+                               continue;
+
                        funcs = mode_set->crtc->helper_private;
                        if (funcs->mode_set_base_atomic == NULL)
                                continue;
 
-                       if (drm_drv_uses_atomic_modeset(mode_set->crtc->dev))
-                               continue;
-
                        funcs->mode_set_base_atomic(mode_set->crtc,
                                                    mode_set->fb,
                                                    mode_set->x,



Home | Main Index | Thread Index | Old Index