From: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
To: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
Hans Verkuil <hverkuil@xs4all.nl>
Subject: [PATCH] v4l: subdev: initialize sd->internal_ops in v4l2_subdev_init
Date: Fri, 1 Apr 2011 11:24:17 -0300 [thread overview]
Message-ID: <1301667857-5145-2-git-send-email-herton.krzesinski@canonical.com> (raw)
In-Reply-To: <1301667857-5145-1-git-send-email-herton.krzesinski@canonical.com>
Many v4l drivers currently don't initialize their struct v4l2_subdev
with zeros, so since the addition of internal_ops in commit 45f6f84, we
are at risk of random oopses when code in v4l2_device_register_subdev
tries to dereference sd->internal_ops->*, as can be shown by the report
at http://bugs.launchpad.net/bugs/745213
So make sure internal_ops is cleared in v4l2_subdev_init.
BugLink: http://bugs.launchpad.net/bugs/745213
Cc: <stable@kernel.org> # .38.x
Signed-off-by: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
---
drivers/media/video/v4l2-subdev.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/media/video/v4l2-subdev.c b/drivers/media/video/v4l2-subdev.c
index 0b80644..0f70c74 100644
--- a/drivers/media/video/v4l2-subdev.c
+++ b/drivers/media/video/v4l2-subdev.c
@@ -324,6 +324,7 @@ void v4l2_subdev_init(struct v4l2_subdev *sd, const struct v4l2_subdev_ops *ops)
sd->grp_id = 0;
sd->dev_priv = NULL;
sd->host_priv = NULL;
+ sd->internal_ops = NULL;
#if defined(CONFIG_MEDIA_CONTROLLER)
sd->entity.name = sd->name;
sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV;
--
1.7.1
next prev parent reply other threads:[~2011-04-01 14:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-01 14:24 Random crashes with v4l2_device_register_subdev Herton Ronaldo Krzesinski
2011-04-01 14:24 ` Herton Ronaldo Krzesinski [this message]
2011-04-01 15:05 ` [PATCH] v4l: subdev: initialize sd->internal_ops in v4l2_subdev_init Hans Verkuil
2011-04-01 15:15 ` Herton Ronaldo Krzesinski
2011-04-01 14:41 ` Random crashes with v4l2_device_register_subdev Andy Walls
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=1301667857-5145-2-git-send-email-herton.krzesinski@canonical.com \
--to=herton.krzesinski@canonical.com \
--cc=hverkuil@xs4all.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@infradead.org \
/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
all inboxes | Powered by JetHome®