Re: [Xen-devel] [PATCH] xen/gntdev: Don't allocate struct gntdev_copy_batch on stack

From: Boris Ostrovsky
Date: Fri Jan 15 2016 - 14:53:03 EST


On 01/15/2016 02:50 PM, Andrew Cooper wrote:
On 15/01/16 19:43, Boris Ostrovsky wrote:
@@ -933,18 +937,20 @@ static long gntdev_ioctl_grant_copy(struct gntdev_priv *priv, void __user *u)
goto out;
}
- ret = gntdev_grant_copy_seg(&batch, &seg, &copy.segments[i].status);
+ ret = gntdev_grant_copy_seg(batch, &seg,
+ &copy.segments[i].status);
if (ret < 0)
goto out;
cond_resched();
}
- if (batch.nr_ops)
- ret = gntdev_copy(&batch);
+ if (batch->nr_ops)
+ ret = gntdev_copy(batch);
You presumably want a kfree() here?

Ah, missed it. Thanks.


return ret;