Skip to contentSkip to conversation

cx2341x: fix kernel oops

PATCH New Hans Verkuil 1 participant 1 message Sep 20, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cx2341x: fix kernel oops

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.

---
 drivers/media/common/cx2341x.c | 1 +
 1 file changed, 1 insertion(+)
drivers/media/common/cx2341x.c +1 -0
index 103ef6b..be76315 100644
@@ -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;
Signature · 1 line
2.1.0