]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/mini-os.git/commitdiff
minios: Fix fb/kbd initialization
authorKeir Fraser <keir.fraser@citrix.com>
Mon, 23 Nov 2009 07:22:28 +0000 (07:22 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Mon, 23 Nov 2009 07:22:28 +0000 (07:22 +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>
fbfront.c

index d06b5351ab890fce6d5ae6f0123a519629846875..0d61ec3fe6df3fffd9bc8624dfb5b228327dcd71 100644 (file)
--- a/fbfront.c
+++ b/fbfront.c
@@ -80,6 +80,7 @@ struct kbdfront_dev *init_kbdfront(char *_nodename, int abs_pointer)
     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 @@ struct fbfront_dev *init_fbfront(char *_nodename, unsigned long *mfns, int width
     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;