[Xen-devel] [PATCH,MINI-OS] Fix fb/kbd initialization

Samuel Thibault
Mon, 23 Nov 2009 00:13:58 -0000

When allocating kbdfront and fbfront structures, we should zero them
since we do not initialize all fields.

Signed-Off-By: Samuel Thibault <samuel.thibault@ens-lyon.org>

diff -r bec27eb6f72c extras/mini-os/fbfront.c
--- a/extras/mini-os/fbfront.c	Sat Nov 14 10:32:59 2009 +0000
+++ b/extras/mini-os/fbfront.c	Mon Nov 23 01:12:31 2009 +0100
@@ -80,6 +80,7 @@
     printk("******************* KBDFRONT for %s **********\n\n\n",
nodename);

     dev = malloc(sizeof(*dev));
+    memset(dev, 0, sizeof(*dev));
     dev->nodename = strdup(nodename);
 #ifdef HAVE_LIBC
     dev->fd = -1;
@@ -403,6 +404,7 @@
     printk("******************* FBFRONT for %s **********\n\n\n",
nodename);

     dev = malloc(sizeof(*dev));
+    memset(dev, 0, sizeof(*dev));
     dev->nodename = strdup(nodename);
 #ifdef HAVE_LIBC
     dev->fd = -1;

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com