diff --git a/[refs] b/[refs] index 73da9a0cd0c0..25c8623f9b4c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d3553a52490dcac54f45083f8fa018e26c22e947 +refs/heads/master: a02c37891a9b2d7ce93f9d09455b4f67c4c23b95 diff --git a/trunk/drivers/vhost/vhost.c b/trunk/drivers/vhost/vhost.c index e36620272715..da21ae951826 100644 --- a/trunk/drivers/vhost/vhost.c +++ b/trunk/drivers/vhost/vhost.c @@ -337,8 +337,10 @@ static long vhost_set_memory(struct vhost_dev *d, struct vhost_memory __user *m) return -EFAULT; } - if (!memory_access_ok(d, newmem, vhost_has_feature(d, VHOST_F_LOG_ALL))) + if (!memory_access_ok(d, newmem, vhost_has_feature(d, VHOST_F_LOG_ALL))) { + kfree(newmem); return -EFAULT; + } oldmem = d->memory; rcu_assign_pointer(d->memory, newmem); synchronize_rcu();