From 1025a960a215b1f47d4497289a7e71a4c9276ef3 Mon Sep 17 00:00:00 2001 From: Glauber Costa <glommer@cloudius-systems.com> Date: Fri, 13 Sep 2013 17:25:53 -0300 Subject: [PATCH] xenfront: initialize softc structure The Xen hypervisor not always initialize its pages. The BSD drivers will however assume they are zeroed, and so things may break if they are not (misterious flag tests suddenly being true, for instance). Initialize manually the data we have just received from malloc when we deal with softc. --- drivers/xenfront.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/xenfront.cc b/drivers/xenfront.cc index 34ae2804b..7aa1828e6 100644 --- a/drivers/xenfront.cc +++ b/drivers/xenfront.cc @@ -75,6 +75,7 @@ void xenfront_driver::set_ivars(struct xenbus_device_ivars *ivars) _bsd_dev.softc = malloc(table->size); // Simpler and we don't expect driver loading to fail anyway assert(_bsd_dev.softc); + memset(_bsd_dev.softc, 0, table->size); } void xenfront_driver::finished() -- GitLab