Browse Source

[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 <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Antti Palosaari 11 years ago
parent
commit
66f6319936
1 changed files with 3 additions and 0 deletions
  1. 3 0
      drivers/media/tuners/tuner_it913x.c

+ 3 - 0
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: