Date: Fri, 9 Oct 2009 03:03:27 +0000 (UTC) From: Nathan Whitehorn <nwhitehorn@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r197892 - in projects/ppc64/sys/powerpc: cell mambo ofw Message-ID: <200910090303.n9933Ruf041067@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: nwhitehorn Date: Fri Oct 9 03:03:26 2009 New Revision: 197892 URL: http://svn.freebsd.org/changeset/base/197892 Log: Fix a trio of NULL pointer dereferences found after making them fatal. Note: the memory allocation scheme used by ofw_real.c is quite fragile. We need to come up with something better. Modified: projects/ppc64/sys/powerpc/cell/celliic.c projects/ppc64/sys/powerpc/mambo/mambo_openpic.c projects/ppc64/sys/powerpc/ofw/ofw_real.c Modified: projects/ppc64/sys/powerpc/cell/celliic.c ============================================================================== --- projects/ppc64/sys/powerpc/cell/celliic.c Fri Oct 9 03:02:30 2009 (r197891) +++ projects/ppc64/sys/powerpc/cell/celliic.c Fri Oct 9 03:03:26 2009 (r197892) @@ -96,7 +96,7 @@ celliic_probe(device_t dev) { const char *type = ofw_bus_get_type(dev); - if (strcmp(type, "stidc-iic") != 0) + if (type == NULL || strcmp(type, "stidc-iic") != 0) return (ENXIO); device_set_desc(dev, "Cell Integrated Interrupt Controller"); Modified: projects/ppc64/sys/powerpc/mambo/mambo_openpic.c ============================================================================== --- projects/ppc64/sys/powerpc/mambo/mambo_openpic.c Fri Oct 9 03:02:30 2009 (r197891) +++ projects/ppc64/sys/powerpc/mambo/mambo_openpic.c Fri Oct 9 03:03:26 2009 (r197892) @@ -121,7 +121,7 @@ openpicbus_mambo_probe(device_t dev) { const char *type = ofw_bus_get_type(dev); - if (strcmp(type, "open-pic") != 0) + if (type == NULL || strcmp(type, "open-pic") != 0) return (ENXIO); device_set_desc(dev, "Mambo OpenPIC Container"); Modified: projects/ppc64/sys/powerpc/ofw/ofw_real.c ============================================================================== --- projects/ppc64/sys/powerpc/ofw/ofw_real.c Fri Oct 9 03:02:30 2009 (r197891) +++ projects/ppc64/sys/powerpc/ofw/ofw_real.c Fri Oct 9 03:03:26 2009 (r197892) @@ -173,7 +173,7 @@ extern struct pmap ofw_pmap; static void ofw_real_bounce_alloc(void *); -SYSINIT(ofw_real_bounce_alloc, SI_SUB_VM, SI_ORDER_ANY, +SYSINIT(ofw_real_bounce_alloc, SI_SUB_KMEM, SI_ORDER_ANY, ofw_real_bounce_alloc, NULL); static void
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200910090303.n9933Ruf041067>