diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c index 9182a44fbb..fd25728041 100644 --- a/xen/common/grant_table.c +++ b/xen/common/grant_table.c @@ -2394,6 +2394,9 @@ __gnttab_swap_grant_ref(grant_ref_t ref_a, grant_ref_t ref_b) spin_lock(>->lock); + if ( gt->gt_version == 0 ) + PIN_FAIL(out, GNTST_general_error, "grant table not yet set up\n"); + /* Bounds check on the grant refs */ if ( unlikely(ref_a >= nr_grant_entries(d->grant_table))) PIN_FAIL(out, GNTST_bad_gntref, "Bad ref-a (%d).\n", ref_a);