diff options
author | Zhouyi Zhou <zhouzhouyi@gmail.com> | 2014-03-05 05:20:19 -0500 |
---|---|---|
committer | Joerg Roedel <joro@8bytes.org> | 2014-03-05 17:02:40 -0500 |
commit | e28045ab2e2a8e27d08275bf70be33868beba8fd (patch) | |
tree | f17793b32ff1e67170595b440d9d84dd73e3cfb0 /drivers/iommu/omap-iommu.c | |
parent | 07a0203021149140f83e64a9ac5fe7ed09a74afc (diff) |
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 <yizhouzhou@ict.ac.cn>
Signed-off-by: Joerg Roedel <joro@8bytes.org>
Diffstat (limited to 'drivers/iommu/omap-iommu.c')
-rw-r--r-- | drivers/iommu/omap-iommu.c | 3 |
1 files changed, 2 insertions, 1 deletions
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) | |||
520 | static void iopte_free(u32 *iopte) | 520 | static void iopte_free(u32 *iopte) |
521 | { | 521 | { |
522 | /* Note: freed iopte's must be clean ready for re-use */ | 522 | /* Note: freed iopte's must be clean ready for re-use */ |
523 | kmem_cache_free(iopte_cachep, iopte); | 523 | if (iopte) |
524 | kmem_cache_free(iopte_cachep, iopte); | ||
524 | } | 525 | } |
525 | 526 | ||
526 | static u32 *iopte_alloc(struct omap_iommu *obj, u32 *iopgd, u32 da) | 527 | static u32 *iopte_alloc(struct omap_iommu *obj, u32 *iopgd, u32 da) |