aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/video/tea6415c.c
diff options
context:
space:
mode:
authorHerton Ronaldo Krzesinski <herton.krzesinski@canonical.com>2011-04-01 14:12:02 -0300
committerGreg Kroah-Hartman <gregkh@suse.de>2011-05-09 15:06:43 -0700
commit658bdc683c81e8016a6be9e3d0c1e5aa139a9b5d (patch)
tree3ff111601d8d4398d68ab11322883ebdfe02457f /drivers/media/video/tea6415c.c
parent4475d537057ad92380f3365ed10f876156a16766 (diff)
v4l: make sure drivers supply a zeroed struct v4l2_subdev
commit 80845a33165278f3236812009e9c568ba8c29938 upstream. Some v4l drivers currently don't initialize their struct v4l2_subdev with zeros, and this is a problem since some of the v4l2 code expects this. One example is the addition of internal_ops in commit 45f6f84, after that we are at risk of random oopses with these drivers 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 and analysis of its crash at https://lkml.org/lkml/2011/4/1/168 Use kzalloc within problematic drivers to ensure we have a zeroed struct v4l2_subdev. BugLink: http://bugs.launchpad.net/bugs/745213 Signed-off-by: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/media/video/tea6415c.c')
-rw-r--r--drivers/media/video/tea6415c.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/video/tea6415c.c b/drivers/media/video/tea6415c.c
index 19621ed523e..827425c5b86 100644
--- a/drivers/media/video/tea6415c.c
+++ b/drivers/media/video/tea6415c.c
@@ -152,7 +152,7 @@ static int tea6415c_probe(struct i2c_client *client,
v4l_info(client, "chip found @ 0x%x (%s)\n",
client->addr << 1, client->adapter->name);
- sd = kmalloc(sizeof(struct v4l2_subdev), GFP_KERNEL);
+ sd = kzalloc(sizeof(struct v4l2_subdev), GFP_KERNEL);
if (sd == NULL)
return -ENOMEM;
v4l2_i2c_subdev_init(sd, client, &tea6415c_ops);