X-Git-Url: https://git.codelabs.ch/?p=muen%2Flinux.git;a=blobdiff_plain;f=drivers%2Fvhost%2Fvhost.c;h=a502f1af4a213607adec4aa28fa6ae8eb9ce0389;hp=ce8c95b6365bbe020ed12078c1a7ae0c65c3cd96;hb=2f3f056685198e9fc76c23bd88fbe2662ab7b044;hpb=4c5e8fc62d6a63065eeae80808c498d1dcfea4f4;ds=inline diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index ce8c95b6365b..a502f1af4a21 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -2349,6 +2349,9 @@ struct vhost_msg_node *vhost_new_msg(struct vhost_virtqueue *vq, int type) struct vhost_msg_node *node = kmalloc(sizeof *node, GFP_KERNEL); if (!node) return NULL; + + /* Make sure all padding within the structure is initialized. */ + memset(&node->msg, 0, sizeof node->msg); node->vq = vq; node->msg.type = type; return node;