Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/evbarm/rpi dont crash if edid data is missing or bad
details: https://anonhg.NetBSD.org/src/rev/91aa911b52fb
branches: trunk
changeset: 784328:91aa911b52fb
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Fri Jan 25 13:32:21 2013 +0000
description:
dont crash if edid data is missing or bad
diffstat:
sys/arch/evbarm/rpi/rpi_machdep.c | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diffs (41 lines):
diff -r c83151be4772 -r 91aa911b52fb sys/arch/evbarm/rpi/rpi_machdep.c
--- a/sys/arch/evbarm/rpi/rpi_machdep.c Fri Jan 25 13:20:23 2013 +0000
+++ b/sys/arch/evbarm/rpi/rpi_machdep.c Fri Jan 25 13:32:21 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rpi_machdep.c,v 1.30 2013/01/21 20:42:22 jakllsch Exp $ */
+/* $NetBSD: rpi_machdep.c,v 1.31 2013/01/25 13:32:21 jmcneill Exp $ */
/*-
* Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rpi_machdep.c,v 1.30 2013/01/21 20:42:22 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rpi_machdep.c,v 1.31 2013/01/25 13:32:21 jmcneill Exp $");
#include "opt_evbarm_boardtype.h"
@@ -609,7 +609,8 @@
}
if (!vcprop_buffer_success_p(&vb_edid.vb_hdr) ||
- !vcprop_tag_success_p(&vb_edid.vbt_edid.tag))
+ !vcprop_tag_success_p(&vb_edid.vbt_edid.tag) ||
+ vb_edid.vbt_edid.status != 0)
return false;
memset(edid_data, 0, sizeof(edid_data));
@@ -620,8 +621,10 @@
edid_print(&ei);
#endif
- *pwidth = ei.edid_preferred_mode->hdisplay;
- *pheight = ei.edid_preferred_mode->vdisplay;
+ if (ei.edid_preferred_mode) {
+ *pwidth = ei.edid_preferred_mode->hdisplay;
+ *pheight = ei.edid_preferred_mode->vdisplay;
+ }
return true;
}
Home |
Main Index |
Thread Index |
Old Index