From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: [PATCH 4 of 6] IOMMU: Sanitise some of our pointer work Date: Wed, 25 May 2011 15:32:06 +0100 Message-ID: <80f7a773887df8b2f244.1306333926@andrewcoop> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: Andrew Cooper List-Id: xen-devel@lists.xenproject.org This is not related to the rest of my kdump changes, but as pointed out by Konrad in a previous thread, we really should make these checks before blindly calling them. Signed-off-by: Andrew Cooper diff -r 2f91c312ade5 -r 80f7a773887d xen/drivers/passthrough/iommu.c --- a/xen/drivers/passthrough/iommu.c Wed May 25 15:11:58 2011 +0100 +++ b/xen/drivers/passthrough/iommu.c Wed May 25 15:12:23 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->resume ) ops->suspend(); }