Module Name: src Committed By: tnn Date: Sun Feb 3 12:39:38 UTC 2019
Modified Files: src/sys/dev/pci: machfb.c Log Message: machfb: guard against absent mode information from firmware To generate a diff of this commit: cvs rdiff -u -r1.95 -r1.96 src/sys/dev/pci/machfb.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/pci/machfb.c diff -u src/sys/dev/pci/machfb.c:1.95 src/sys/dev/pci/machfb.c:1.96 --- src/sys/dev/pci/machfb.c:1.95 Mon Sep 3 16:29:32 2018 +++ src/sys/dev/pci/machfb.c Sun Feb 3 12:39:38 2019 @@ -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 @@ mach64_attach(device_t parent, device_t } } /* 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));