Skip to content

Commit

Permalink
[media] cx2341x: fix kernel oops
Browse files Browse the repository at this point in the history
The v4l2_ctrl_config struct must be zeroed before passing it to
v4l2_ctrl_new_custom(). This was always wrong, but with the recent
v4l2-ctrls.c changes this is now much more likely to lead to a
kernel bug.

This is the only place where this struct wasn't initialized properly.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reported-by: Pridvorov Andrey <ua0lnj@bk.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Sep 21, 2014
1 parent fdc6b38 commit 50394e7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/media/common/cx2341x.c
Original file line number Diff line number Diff line change
Expand Up @@ -1490,6 +1490,7 @@ static struct v4l2_ctrl *cx2341x_ctrl_new_custom(struct v4l2_ctrl_handler *hdl,
{
struct v4l2_ctrl_config cfg;

memset(&cfg, 0, sizeof(cfg));
cx2341x_ctrl_fill(id, &cfg.name, &cfg.type, &min, &max, &step, &def, &cfg.flags);
cfg.ops = &cx2341x_ops;
cfg.id = id;
Expand Down

0 comments on commit 50394e7

Please sign in to comment.