[PATCH 1/1] omap3isp: Prevent crash at module unload

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



iommu_domain_free() was called in isp_remove() before omap3isp_put().
omap3isp_put() must not save the context if the IOMMU no longer is there.
Fix this.

Signed-off-by: Sakari Ailus <sakari.ailus@xxxxxx>
---
The issue only seems to affect the staging/for_v3.4 branch in
media-tree.git.

 drivers/media/video/omap3isp/isp.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/omap3isp/isp.c b/drivers/media/video/omap3isp/isp.c
index 12d5f92..c3ff142 100644
--- a/drivers/media/video/omap3isp/isp.c
+++ b/drivers/media/video/omap3isp/isp.c
@@ -1112,7 +1112,8 @@ isp_restore_context(struct isp_device *isp, struct isp_reg *reg_list)
 static void isp_save_ctx(struct isp_device *isp)
 {
 	isp_save_context(isp, isp_reg_list);
-	omap_iommu_save_ctx(isp->dev);
+	if (isp->domain)
+		omap_iommu_save_ctx(isp->dev);
 }
 
 /*
@@ -1981,6 +1982,7 @@ static int isp_remove(struct platform_device *pdev)
 	omap3isp_get(isp);
 	iommu_detach_device(isp->domain, &pdev->dev);
 	iommu_domain_free(isp->domain);
+	isp->domain = NULL;
 	omap3isp_put(isp);
 
 	free_irq(isp->irq_num, isp);
-- 
1.7.2.5

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux