Linux IOMMU Development
 help / color / mirror / Atom feed
* [PATCH v2] IOMMU: iopte free should check wether input argument is NULL
@ 2014-03-05 10:20 Zhouyi Zhou
       [not found] ` <1394014820-1249-1-git-send-email-yizhouzhou-6xnC4QlcT6v/PtFMR13I2A@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Zhouyi Zhou @ 2014-03-05 10:20 UTC (permalink / raw)
  To: joro-zLv9SwRftAIdnm+yROfE0A,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: Zhouyi Zhou, Zhouyi Zhou

From: Zhouyi Zhou <zhouzhouyi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

iopte free should check wether input argument is NULL because kmem_cache_free
will panic on NULL argument 

Signed-off-by: Zhouyi Zhou <yizhouzhou-6xnC4QlcT6v/PtFMR13I2A@public.gmane.org>
Signed-off-by: Joerg Roedel <joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>

---
 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 bcd78a7..51211e8 100644
--- a/drivers/iommu/omap-iommu.c
+++ b/drivers/iommu/omap-iommu.c
@@ -523,7 +523,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)

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] IOMMU: iopte free should check wether input argument is NULL
       [not found] ` <1394014820-1249-1-git-send-email-yizhouzhou-6xnC4QlcT6v/PtFMR13I2A@public.gmane.org>
@ 2014-03-05 22:47   ` Joerg Roedel
  0 siblings, 0 replies; 2+ messages in thread
From: Joerg Roedel @ 2014-03-05 22:47 UTC (permalink / raw)
  To: Zhouyi Zhou
  Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Zhouyi Zhou

On Wed, Mar 05, 2014 at 06:20:19PM +0800, Zhouyi Zhou wrote:
> From: Zhouyi Zhou <zhouzhouyi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> 
> iopte free should check wether input argument is NULL because kmem_cache_free
> will panic on NULL argument 
> 
> Signed-off-by: Zhouyi Zhou <yizhouzhou-6xnC4QlcT6v/PtFMR13I2A@public.gmane.org>
> Signed-off-by: Joerg Roedel <joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
> 
> ---
>  drivers/iommu/omap-iommu.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-03-05 22:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-05 10:20 [PATCH v2] IOMMU: iopte free should check wether input argument is NULL Zhouyi Zhou
     [not found] ` <1394014820-1249-1-git-send-email-yizhouzhou-6xnC4QlcT6v/PtFMR13I2A@public.gmane.org>
2014-03-05 22:47   ` Joerg Roedel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox