From: Keir Fraser Subject: Re: [PATCH 3 of 7] IOMMU: Sanitise pointer work Date: Mon, 13 Jun 2011 19:13:27 +0100 Message-ID: References: <68efd418b6f149034aed.1307984570@andrewcoop.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <68efd418b6f149034aed.1307984570@andrewcoop.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Andrew Cooper , xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On 13/06/2011 18:02, "Andrew Cooper" wrote: > Check for null pointers before calling function pointers. But they're never NULL? This one's a bit pointless. -- Keir > Signed-off-by: Andrew Cooper > > diff -r 1c3d2e4d06fe -r 68efd418b6f1 xen/drivers/passthrough/iommu.c > --- a/xen/drivers/passthrough/iommu.c Mon Jun 13 17:45:43 2011 +0100 > +++ b/xen/drivers/passthrough/iommu.c Mon Jun 13 17:45:43 2011 +0100 > @@ -407,17 +407,17 @@ unsigned int iommu_read_apic_from_ire(un > return ops->read_apic_from_ire(apic, reg); > } > > -void iommu_resume() > +void iommu_resume(void) > { > const struct iommu_ops *ops = iommu_get_ops(); > - if ( iommu_enabled ) > + if ( iommu_enabled && ops && ops->resume ) > ops->resume(); > } > > -void iommu_suspend() > +void iommu_suspend(void) > { > const struct iommu_ops *ops = iommu_get_ops(); > - if ( iommu_enabled ) > + if ( iommu_enabled && ops && ops->suspend ) > ops->suspend(); > } > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel