Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci machfb: guard against absent mode information fr...



details:   https://anonhg.NetBSD.org/src/rev/a2eeeee9fcf2
branches:  trunk
changeset: 448458:a2eeeee9fcf2
user:      tnn <tnn%NetBSD.org@localhost>
date:      Sun Feb 03 12:39:38 2019 +0000

description:
machfb: guard against absent mode information from firmware

diffstat:

 sys/dev/pci/machfb.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 4a7334e81984 -r a2eeeee9fcf2 sys/dev/pci/machfb.c
--- a/sys/dev/pci/machfb.c      Sun Feb 03 12:18:21 2019 +0000
+++ b/sys/dev/pci/machfb.c      Sun Feb 03 12:39:38 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machfb.c,v 1.95 2018/09/03 16:29:32 riastradh Exp $    */
+/*     $NetBSD: machfb.c,v 1.96 2019/02/03 12:39:38 tnn Exp $  */
 
 /*
  * Copyright (c) 2002 Bang Jun-Young
@@ -34,7 +34,7 @@
 
 #include <sys/cdefs.h>
 __KERNEL_RCSID(0,
-       "$NetBSD: machfb.c,v 1.95 2018/09/03 16:29:32 riastradh Exp $");
+       "$NetBSD: machfb.c,v 1.96 2019/02/03 12:39:38 tnn Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -645,7 +645,7 @@
                        }
                }
                /* got nothing? try to pick one based on firmware parameters */
-               if (setmode == 0) {
+               if (setmode == 0 && width > 0 && height > 0) {
                        /* no EDID data? */
                        mode = pick_mode_by_ref(width, height, 60);
                        memcpy(&default_mode, mode, sizeof(struct videomode));



Home | Main Index | Thread Index | Old Index