From: Samuel Thibault Subject: [PATCH,MINI-OS] Fix fb/kbd initialization Date: Mon, 23 Nov 2009 01:13:58 +0100 Message-ID: <20091123001358.GI4629@const.famille.thibault.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org When allocating kbdfront and fbfront structures, we should zero them since we do not initialize all fields. Signed-Off-By: Samuel Thibault 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;