From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: [Patch] hvm/vidirian: Avoid printing page_to_mfn(NULL) on error paths. Date: Wed, 09 Oct 2013 06:26:32 +0100 Message-ID: References: <1381263454-28115-1-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1381263454-28115-1-git-send-email-andrew.cooper3@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper , Xen-devel Cc: Tim Deegan , Jan Beulich List-Id: xen-devel@lists.xenproject.org On 08/10/2013 21:17, "Andrew Cooper" wrote: > While working in the viridian code, I noticed that 4cb6c4f4941 > > "x86/hvm: Use get_page_from_gfn() instead of get_gfn()/put_gfn." > > introduced two error paths where page_to_mfn(NULL) would be formatted and > presented as a bad MFN. This provides junk in the warning rather than > something useful. > > These two codepaths are fixed up to match their counterpart in > wrmsr_hypervisor_regs() > > While auditing the other changes from 4cb6c4f4941, I noticed a small > optimisation which could be made by changing the order of the validity checks > to remove 6 NULL pointer checks. > > Signed-off-by: Andrew Cooper > CC: Keir Fraser > CC: Jan Beulich > CC: Tim Deegan Acked-by: Keir Fraser