Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 24427:
931bf1105730
xen-unstable date: Sun Dec 18 14:38:32 2011 +0000
case GNTTABOP_query_size:
case GNTTABOP_setup_table:
case GNTTABOP_set_version:
+ case GNTTABOP_get_version:
case GNTTABOP_copy:
case GNTTABOP_map_grant_ref:
case GNTTABOP_unmap_grant_ref:
{
gnttab_get_version_t op;
struct domain *d;
+ int rc;
if ( copy_from_guest(&op, uop, 1) )
return -EFAULT;
- d = rcu_lock_domain_by_id(op.dom);
- if ( d == NULL )
- return -ESRCH;
- if ( !IS_PRIV_FOR(current->domain, d) )
- {
- rcu_unlock_domain(d);
- return -EPERM;
- }
+
+ rc = rcu_lock_target_domain_by_id(op.dom, &d);
+ if ( rc < 0 )
+ return rc;
+
spin_lock(&d->grant_table->lock);
op.version = d->grant_table->gt_version;
spin_unlock(&d->grant_table->lock);