Commit c51d8fca authored by Wei Wang's avatar Wei Wang Committed by Michael S. Tsirkin

virtio-balloon: kzalloc the vb struct

Zero all the vb fields at alloaction, so that we don't need to
zero-initialize each field one by one later.
Signed-off-by: default avatarWei Wang <>
Cc: Michael S. Tsirkin <>
Cc: Tetsuo Handa <>
Signed-off-by: default avatarMichael S. Tsirkin <>
parent 74cf5b16
......@@ -561,7 +561,7 @@ static int virtballoon_probe(struct virtio_device *vdev)
return -EINVAL;
vdev->priv = vb = kmalloc(sizeof(*vb), GFP_KERNEL);
vdev->priv = vb = kzalloc(sizeof(*vb), GFP_KERNEL);
if (!vb) {
err = -ENOMEM;
goto out;
......@@ -570,8 +570,6 @@ static int virtballoon_probe(struct virtio_device *vdev)
INIT_WORK(&vb->update_balloon_stats_work, update_balloon_stats_func);
INIT_WORK(&vb->update_balloon_size_work, update_balloon_size_func);
vb->stop_update = false;
vb->num_pages = 0;
vb->vdev = vdev;
......@@ -602,7 +600,6 @@ static int virtballoon_probe(struct virtio_device *vdev)
err = PTR_ERR(vb->vb_dev_info.inode);
vb->vb_dev_info.inode = NULL;
goto out_del_vqs;
vb->vb_dev_info.inode->i_mapping->a_ops = &balloon_aops;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment