From: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] v4l: subdev: initialize sd->internal_ops in v4l2_subdev_init
Date: Fri, 1 Apr 2011 12:15:14 -0300 [thread overview]
Message-ID: <20110401151513.GA2347@herton-IdeaPad-Y430> (raw)
In-Reply-To: <201104011705.27742.hverkuil@xs4all.nl>
On Fri, Apr 01, 2011 at 05:05:27PM +0200, Hans Verkuil wrote:
> On Friday, April 01, 2011 16:24:17 Herton Ronaldo Krzesinski wrote:
> > 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.
>
> NACK: we need to replace those kmalloc's with kzalloc. This patch will just
> fix the internal_ops problem, but sd->entity isn't zeroed. It's going to be
> a neverending problem unless we fix those kmalloc's. It is my fault, I guess:
> I should always have required the use of kzalloc.
>
> I grepped for this and the number of kmalloc's is quite small:
>
> drivers/media/video/tda9840.c
> drivers/media/video/upd64031a.c
> drivers/media/video/m52790.c
> drivers/media/video/tea6415c.c
> drivers/media/video/tea6420.c
> drivers/media/video/upd64083.c
> drivers/media/radio/saa7706h.c
> drivers/media/radio/tef6862.c
>
> If you fix those kmalloc's, then I'll ack those changes. There is just one
> relevant kmalloc in each file.
>
> The reason this wasn't noticed before is that all these devices are all
> pretty rare. All the more common device drivers use kzalloc. I am really
> surprised to hear of mxb boards still in use! Just for the record: I have
> one myself for testing, although I clearly never realized that I should
> test that particular change with that board...
>
> Thanks for doing such a great job of tracking this down!
No problem, I'll take a look and send a new patch.
>
> Regards,
>
> Hans
>
--
[]'s
Herton
next prev parent reply other threads:[~2011-04-01 15:15 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 ` [PATCH] v4l: subdev: initialize sd->internal_ops in v4l2_subdev_init Herton Ronaldo Krzesinski
2011-04-01 15:05 ` Hans Verkuil
2011-04-01 15:15 ` Herton Ronaldo Krzesinski [this message]
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=20110401151513.GA2347@herton-IdeaPad-Y430 \
--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