lkml.org 
[lkml]   [2012]   [Oct]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Xen-devel] [PATCH V3 6/6]: PVH:privcmd changes.
On Thu, 18 Oct 2012 11:35:53 +0100
Ian Campbell <Ian.Campbell@citrix.com> wrote:

>
> > @@ -439,6 +490,19 @@ static long privcmd_ioctl(struct file *file,
> > return ret;
> > }
> >
> > +static void privcmd_close(struct vm_area_struct *vma)
> > +{
> > + struct page **pages = vma ? vma->vm_private_data : NULL;
>
> Can VMA really be NULL?...

Good programming I thought!

> > + int numpgs = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
>
> ...I assume not since you unconditionally dereference it here.

Added this later, and just didn't change the earlier part.

> > + if (!pages || !numpgs
> > || !xen_feature(XENFEAT_auto_translated_physmap))
>
> In the non-xlat case pages will (or should!) be 1 here which will pass
> the first clause of the test.
>
> Although the later clauses will catch this I think it would be worth
> ordering the checks such that they are each valid, perhaps by pulling
> the feature check to the front or by separating the !xlat case from
> the other two which are valid iff xlat == True.
>



\
 
 \ /
  Last update: 2012-10-19 02:41    [W:0.131 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site