linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC] omap3isp: prevent releasing MC too early
@ 2016-12-14 15:14 Mauro Carvalho Chehab
  2016-12-15 12:13 ` Laurent Pinchart
  0 siblings, 1 reply; 16+ messages in thread
From: Mauro Carvalho Chehab @ 2016-12-14 15:14 UTC (permalink / raw)
  To: Shuah Khan, javier, Linux Media Mailing List
  Cc: Mauro Carvalho Chehab, Mauro Carvalho Chehab

Avoid calling streamoff without having the media structs allocated.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
---

Javier,

Could you please test this patch?

Thanks!
Mauro

 drivers/media/platform/omap3isp/ispvideo.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/omap3isp/ispvideo.c b/drivers/media/platform/omap3isp/ispvideo.c
index 7354469670b7..f60995ed0a1f 100644
--- a/drivers/media/platform/omap3isp/ispvideo.c
+++ b/drivers/media/platform/omap3isp/ispvideo.c
@@ -1488,11 +1488,17 @@ int omap3isp_video_register(struct isp_video *video, struct v4l2_device *vdev)
 			"%s: could not register video device (%d)\n",
 			__func__, ret);
 
+	/* Prevent destroying MC before unregistering */
+	kobject_get(vdev->v4l2_dev->mdev->devnode->dev.parent);
+
 	return ret;
 }
 
 void omap3isp_video_unregister(struct isp_video *video)
 {
-	if (video_is_registered(&video->video))
-		video_unregister_device(&video->video);
+	if (!video_is_registered(&video->video))
+		return;
+
+	video_unregister_device(&video->video);
+	kobject_put(vdev->v4l2_dev->mdev->devnode->dev.parent);
 }
-- 
2.9.3


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

end of thread, other threads:[~2016-12-16 16:06 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-14 15:14 [PATCH RFC] omap3isp: prevent releasing MC too early Mauro Carvalho Chehab
2016-12-15 12:13 ` Laurent Pinchart
2016-12-15 12:31   ` Greg KH
2016-12-15 15:07     ` Laurent Pinchart
2016-12-15 16:58     ` Mauro Carvalho Chehab
2016-12-15 12:37   ` Mauro Carvalho Chehab
2016-12-15 12:42     ` Javier Martinez Canillas
2016-12-15 12:57       ` Mauro Carvalho Chehab
2016-12-15 13:44         ` Greg KH
2016-12-15 14:17           ` Mauro Carvalho Chehab
2016-12-16  8:21             ` Sakari Ailus
2016-12-16 11:44               ` Sakari Ailus
2016-12-15 14:04         ` Laurent Pinchart
2016-12-16 11:18           ` Mauro Carvalho Chehab
2016-12-16 16:06             ` Laurent Pinchart
2016-12-15 13:24     ` Laurent Pinchart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).