Module Name: src
Committed By: ahoka
Date: Tue Apr 12 18:10:15 UTC 2011
Modified Files:
src/sys/arch/arm/omap: omapfb.c
Log Message:
avoid a crash when the display size is reported as 1x1
XXX this is hackish, it should be properly fixed instead
To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/omap/omapfb.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/arch/arm/omap/omapfb.c
diff -u src/sys/arch/arm/omap/omapfb.c:1.1 src/sys/arch/arm/omap/omapfb.c:1.2
--- src/sys/arch/arm/omap/omapfb.c:1.1 Tue Aug 31 19:03:55 2010
+++ src/sys/arch/arm/omap/omapfb.c Tue Apr 12 18:10:15 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: omapfb.c,v 1.1 2010/08/31 19:03:55 macallan Exp $ */
+/* $NetBSD: omapfb.c,v 1.2 2011/04/12 18:10:15 ahoka Exp $ */
/*
* Copyright (c) 2010 Michael Lorenz
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: omapfb.c,v 1.1 2010/08/31 19:03:55 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omapfb.c,v 1.2 2011/04/12 18:10:15 ahoka Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -179,6 +179,11 @@
sc->sc_depth = 16;
sc->sc_stride = sc->sc_width << 1;
+ if (sc->sc_width == 1 || sc->sc_height == 1) {
+ aprint_error_dev(self, "bogus display size, not attaching\n");
+ return;
+ }
+
printf("%s: firmware set up %d x %d\n", device_xname(self),
sc->sc_width, sc->sc_height);
#if 0