svn commit: r307763 - head/sys/dev/dpaa
Justin Hibbits
jhibbits at FreeBSD.org
Sat Oct 22 02:11:54 UTC 2016
Author: jhibbits
Date: Sat Oct 22 02:11:53 2016
New Revision: 307763
URL: https://svnweb.freebsd.org/changeset/base/307763
Log:
Initialize the ofw_bus_devinfo on the portals to prevent a crash.
If the device tree doesn't contain a cpu-handle field in any bman-portal or
qman-portal, it will exit without setting up the devinfo, leaving it
uninitialized. This will lead to attempts to free random memory, and ultimately
panic.
Modified:
head/sys/dev/dpaa/bman_fdt.c
head/sys/dev/dpaa/qman_fdt.c
Modified: head/sys/dev/dpaa/bman_fdt.c
==============================================================================
--- head/sys/dev/dpaa/bman_fdt.c Sat Oct 22 01:58:21 2016 (r307762)
+++ head/sys/dev/dpaa/bman_fdt.c Sat Oct 22 02:11:53 2016 (r307763)
@@ -143,7 +143,7 @@ bman_portals_fdt_attach(device_t dev)
ihandle_t cpu;
int cpu_num, cpus, intr_rid;
struct dpaa_portals_devinfo di;
- struct ofw_bus_devinfo ofw_di;
+ struct ofw_bus_devinfo ofw_di = {};
cpus = 0;
sc = device_get_softc(dev);
Modified: head/sys/dev/dpaa/qman_fdt.c
==============================================================================
--- head/sys/dev/dpaa/qman_fdt.c Sat Oct 22 01:58:21 2016 (r307762)
+++ head/sys/dev/dpaa/qman_fdt.c Sat Oct 22 02:11:53 2016 (r307763)
@@ -143,7 +143,7 @@ qman_portals_fdt_attach(device_t dev)
ihandle_t cpu;
int cpu_num, cpus, intr_rid;
struct dpaa_portals_devinfo di;
- struct ofw_bus_devinfo ofw_di;
+ struct ofw_bus_devinfo ofw_di = {};
cpus = 0;
sc = device_get_softc(dev);
More information about the svn-src-all
mailing list