提交 e4129a9c 编写于 作者: H Hans Verkuil 提交者: Mauro Carvalho Chehab

V4L/DVB (11277): tvaudio: always call init_timer to prevent rmmod crash.

In the tvaudio_remove function del_timer_sync(&chip->wt) is called.
However, chip->wt isn't always initialized depending on the type of
audio chip. Since del_timer_sync hangs when given an uninitialized timer
we should always initialize it.
Signed-off-by: NHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 411674fd
...@@ -2050,6 +2050,7 @@ static int tvaudio_probe(struct i2c_client *client, const struct i2c_device_id * ...@@ -2050,6 +2050,7 @@ static int tvaudio_probe(struct i2c_client *client, const struct i2c_device_id *
} }
chip->thread = NULL; chip->thread = NULL;
init_timer(&chip->wt);
if (desc->flags & CHIP_NEED_CHECKMODE) { if (desc->flags & CHIP_NEED_CHECKMODE) {
if (!desc->getmode || !desc->setmode) { if (!desc->getmode || !desc->setmode) {
/* This shouldn't be happen. Warn user, but keep working /* This shouldn't be happen. Warn user, but keep working
...@@ -2059,7 +2060,6 @@ static int tvaudio_probe(struct i2c_client *client, const struct i2c_device_id * ...@@ -2059,7 +2060,6 @@ static int tvaudio_probe(struct i2c_client *client, const struct i2c_device_id *
return 0; return 0;
} }
/* start async thread */ /* start async thread */
init_timer(&chip->wt);
chip->wt.function = chip_thread_wake; chip->wt.function = chip_thread_wake;
chip->wt.data = (unsigned long)chip; chip->wt.data = (unsigned long)chip;
chip->thread = kthread_run(chip_thread, chip, client->name); chip->thread = kthread_run(chip_thread, chip, client->name);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册