From: vhanquez@kneesa.uk.xensource.com Date: Wed, 25 Jan 2006 11:51:21 +0000 (+0000) Subject: Separate the validity checking of the page frame in 2 chunks. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~16531^2~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=4d6a50d0bec3944b23bbf71e457bc5effc8cd981;p=xen.git Separate the validity checking of the page frame in 2 chunks. give a more accurate error message, and don't call pfn_to_page before validating the pfn. Signed-off-by: Vincent Hanquez --- diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c index 93312868b2..7576d715d3 100644 --- a/xen/common/grant_table.c +++ b/xen/common/grant_table.c @@ -719,10 +719,18 @@ gnttab_transfer( } /* Check the passed page frame for basic validity. */ + if ( unlikely(!pfn_valid(gop.mfn)) ) + { + DPRINTK("gnttab_transfer: out-of-range %lx\n", + (unsigned long)gop.mfn); + (void)__put_user(GNTST_bad_page, &uop[i].status); + continue; + } + page = pfn_to_page(gop.mfn); - if ( unlikely(!pfn_valid(gop.mfn) || IS_XEN_HEAP_FRAME(page)) ) + if ( unlikely(IS_XEN_HEAP_FRAME(page)) ) { - DPRINTK("gnttab_transfer: out-of-range or xen frame %lx\n", + DPRINTK("gnttab_transfer: xen frame %lx\n", (unsigned long)gop.mfn); (void)__put_user(GNTST_bad_page, &uop[i].status); continue;