xen/gntalloc: fix oops after runnning out of grant refs
Only set gref->gref_id if foreign access was successfully granted and the grant ref is valid. If gref->gref_id == -ENOSPC the test in __del_gref() would incorrectly attempt to end foreign access (because grant_ref_t is unsigned). Signed-off-by: NDavid Vrabel <david.vrabel@citrix.com> Reported-by: NDave Scott <dave.scott@citrix.com> Reviewed-by: NBoris Ostrovsky <boris.ostrovsky@oracle.com>
Showing
想要评论请 注册 或 登录