From: Antti Palosaari Date: Sat, 9 Aug 2014 15:35:00 +0000 (-0300) Subject: [media] it913x: avoid division by zero on error case X-Git-Tag: firefly_0821_release~176^2~2474^2~600 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=66f6319936344279466bd09f9788e888e03c99a0;p=firefly-linux-kernel-4.4.55.git [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 --- 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: