From 66f6319936344279466bd09f9788e888e03c99a0 Mon Sep 17 00:00:00 2001 From: Antti Palosaari Date: Sat, 9 Aug 2014 12:35:00 -0300 Subject: [PATCH] [media] it913x: avoid division by zero on error case Error on init leaves some internal divisor zero, which causes oops later. Fix it by populating divisors even it fails. Signed-off-by: Antti Palosaari Signed-off-by: Mauro Carvalho Chehab --- drivers/media/tuners/tuner_it913x.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/media/tuners/tuner_it913x.c b/drivers/media/tuners/tuner_it913x.c index 3265d9ab3c67..cd20c5b0f07e 100644 --- a/drivers/media/tuners/tuner_it913x.c +++ b/drivers/media/tuners/tuner_it913x.c @@ -154,6 +154,9 @@ static int it913x_init(struct dvb_frontend *fe) val = 16; break; case -ENODEV: + /* FIXME: these are just avoid divide by 0 */ + state->tun_xtal = 2000; + state->tun_fdiv = 3; return -ENODEV; case 1: default: -- 2.20.1