ia64/xen-unstable
changeset 8657:aad2b2da3c8b
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 <vincent@xensource.com>
give a more accurate error message, and don't call pfn_to_page before
validating the pfn.
Signed-off-by: Vincent Hanquez <vincent@xensource.com>
author | vhanquez@kneesa.uk.xensource.com |
---|---|
date | Wed Jan 25 11:51:21 2006 +0000 (2006-01-25) |
parents | 159ef7d83f1c |
children | 709bce2f08d6 |
files | xen/common/grant_table.c |
line diff
1.1 --- a/xen/common/grant_table.c Wed Jan 25 12:34:02 2006 +0100 1.2 +++ b/xen/common/grant_table.c Wed Jan 25 11:51:21 2006 +0000 1.3 @@ -719,10 +719,18 @@ gnttab_transfer( 1.4 } 1.5 1.6 /* Check the passed page frame for basic validity. */ 1.7 + if ( unlikely(!pfn_valid(gop.mfn)) ) 1.8 + { 1.9 + DPRINTK("gnttab_transfer: out-of-range %lx\n", 1.10 + (unsigned long)gop.mfn); 1.11 + (void)__put_user(GNTST_bad_page, &uop[i].status); 1.12 + continue; 1.13 + } 1.14 + 1.15 page = pfn_to_page(gop.mfn); 1.16 - if ( unlikely(!pfn_valid(gop.mfn) || IS_XEN_HEAP_FRAME(page)) ) 1.17 + if ( unlikely(IS_XEN_HEAP_FRAME(page)) ) 1.18 { 1.19 - DPRINTK("gnttab_transfer: out-of-range or xen frame %lx\n", 1.20 + DPRINTK("gnttab_transfer: xen frame %lx\n", 1.21 (unsigned long)gop.mfn); 1.22 (void)__put_user(GNTST_bad_page, &uop[i].status); 1.23 continue;