From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Cc: Shuah Khan <shuahkh@osg.samsung.com>,
javier@osg.samsung.com,
Linux Media Mailing List <linux-media@vger.kernel.org>,
Mauro Carvalho Chehab <mchehab@infradead.org>,
Greg KH <greg@kroah.com>
Subject: Re: [PATCH RFC] omap3isp: prevent releasing MC too early
Date: Thu, 15 Dec 2016 14:13:42 +0200 [thread overview]
Message-ID: <3043978.ViByGAdkJL@avalon> (raw)
In-Reply-To: <20161214151406.20380-1-mchehab@s-opensource.com>
Hi Mauro,
(CC'ing Greg)
On Wednesday 14 Dec 2016 13:14:06 Mauro Carvalho Chehab wrote:
> Avoid calling streamoff without having the media structs allocated.
>
> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
The driver has a maintainer listed in MAINTAINERS, and you know that Sakari is
also actively involved here. You could have CC'ed us.
> ---
>
> 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);
This doesn't even compile. Please make sure to at least compile-test patches
you send for review, otherwise you end up wasting time for all reviewers and
testers. I assume you meant
kobject_get(&vdev->mdev->devnode->dev.parent->kobj);
and similarly below.
That's a long list of pointer dereferences, going deep down the device core.
Greg, are drivers allowed to do this by the driver model ?
> +
> 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);
> }
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2016-12-15 12:13 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-14 15:14 [PATCH RFC] omap3isp: prevent releasing MC too early Mauro Carvalho Chehab
2016-12-15 12:13 ` Laurent Pinchart [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3043978.ViByGAdkJL@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=greg@kroah.com \
--cc=javier@osg.samsung.com \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@infradead.org \
--cc=mchehab@s-opensource.com \
--cc=shuahkh@osg.samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).