Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/wsfb Fixed NULL-pointer dereferencing when a mode-ca...
details: https://anonhg.NetBSD.org/src/rev/bde331e5a1e4
branches: trunk
changeset: 761974:bde331e5a1e4
user: phx <phx%NetBSD.org@localhost>
date: Sat Feb 12 17:15:27 2011 +0000
description:
Fixed NULL-pointer dereferencing when a mode-callback is not defined.
diffstat:
sys/dev/wsfb/genfb.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diffs (36 lines):
diff -r b2641296eb07 -r bde331e5a1e4 sys/dev/wsfb/genfb.c
--- a/sys/dev/wsfb/genfb.c Sat Feb 12 16:40:29 2011 +0000
+++ b/sys/dev/wsfb/genfb.c Sat Feb 12 17:15:27 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: genfb.c,v 1.35 2011/02/09 13:19:19 jmcneill Exp $ */
+/* $NetBSD: genfb.c,v 1.36 2011/02/12 17:15:27 phx Exp $ */
/*-
* Copyright (c) 2007 Michael Lorenz
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: genfb.c,v 1.35 2011/02/09 13:19:19 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfb.c,v 1.36 2011/02/12 17:15:27 phx Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -235,7 +235,7 @@
sc->sc_screenlist = (struct wsscreen_list){1, sc->sc_screens};
memcpy(&sc->sc_ops, ops, sizeof(struct genfb_ops));
sc->sc_mode = WSDISPLAYIO_MODE_EMUL;
- if (sc->sc_modecb->gmc_setmode)
+ if (sc->sc_modecb != NULL)
sc->sc_modecb->gmc_setmode(sc, sc->sc_mode);
#ifdef GENFB_SHADOWFB
@@ -386,7 +386,7 @@
if (new_mode != sc->sc_mode) {
sc->sc_mode = new_mode;
- if (sc->sc_modecb->gmc_setmode)
+ if (sc->sc_modecb != NULL)
sc->sc_modecb->gmc_setmode(sc,
sc->sc_mode);
if (new_mode == WSDISPLAYIO_MODE_EMUL) {
Home |
Main Index |
Thread Index |
Old Index