From: Ernst Martin Witte Date: Sat, 9 Jan 2016 20:18:43 +0000 (-0200) Subject: [media] si2157: cancel_delayed_work_sync before device removal / kfree X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=01d1d714e26624bc50ba95c49cf6e15bb215c150;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [media] si2157: cancel_delayed_work_sync before device removal / kfree si2157_remove was calling kfree(dev) with possibly still active schedule_delayed_work(dev->stat_work). This caused kernel panics in call_timer_fn e.g. after rmmod cx23885. Signed-off-by: Ernst Martin Witte Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c index 5da5b421d310..3450dfb7c427 100644 --- a/drivers/media/tuners/si2157.c +++ b/drivers/media/tuners/si2157.c @@ -458,6 +458,9 @@ static int si2157_remove(struct i2c_client *client) dev_dbg(&client->dev, "\n"); + /* stop statistics polling */ + cancel_delayed_work_sync(&dev->stat_work); + memset(&fe->ops.tuner_ops, 0, sizeof(struct dvb_tuner_ops)); fe->tuner_priv = NULL; kfree(dev);