From: Zhouyi Zhou Date: Wed, 5 Mar 2014 10:20:19 +0000 (+0800) Subject: iommu/omap: Check for NULL in iopte_free() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e28045ab2e2a8e27d08275bf70be33868beba8fd;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git iommu/omap: Check for NULL in iopte_free() The iopte_free() function should check for NULL because kmem_cache_free() will panic on NULL argument. Signed-off-by: Zhouyi Zhou Signed-off-by: Joerg Roedel --- diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c index 8acea87cbc0e..7fcbfc498fa9 100644 --- a/drivers/iommu/omap-iommu.c +++ b/drivers/iommu/omap-iommu.c @@ -520,7 +520,8 @@ static void flush_iopte_range(u32 *first, u32 *last) static void iopte_free(u32 *iopte) { /* Note: freed iopte's must be clean ready for re-use */ - kmem_cache_free(iopte_cachep, iopte); + if (iopte) + kmem_cache_free(iopte_cachep, iopte); } static u32 *iopte_alloc(struct omap_iommu *obj, u32 *iopgd, u32 da)