From: Ian Campbell <Ian.Campbell@citrix.com>
To: Mukesh Rathor <mukesh.rathor@oracle.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
"Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [Xen-devel] [PATCH V3 6/6]: PVH:privcmd changes.
Date: Thu, 18 Oct 2012 11:35:53 +0100 [thread overview]
Message-ID: <1350556553.2460.108.camel@zakaz.uk.xensource.com> (raw)
In-Reply-To: <20121017173448.7ef4c0b1@mantra.us.oracle.com>
> @@ -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?...
> + int numpgs = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
...I assume not since you unconditionally dereference it here.
> + 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.
next prev parent reply other threads:[~2012-10-18 10:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-18 0:34 Mukesh Rathor
2012-10-18 10:35 ` Ian Campbell [this message]
2012-10-19 0:02 ` [Xen-devel] " Mukesh Rathor
2012-10-18 11:52 ` Stefano Stabellini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1350556553.2460.108.camel@zakaz.uk.xensource.com \
--to=ian.campbell@citrix.com \
--cc=Xen-devel@lists.xensource.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mukesh.rathor@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®