Skip to content

Commit a6bab88

Browse files
pboettchMauro Carvalho Chehab
authored andcommitted
V4L/DVB (3320): Check if PLL-description is set
- Check if in the dvb-usb-device-structure the dvb_pll_desc is set before use. Signed-off-by: Patrick Boettcher <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 4e5910e commit a6bab88

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/media/dvb/dvb-usb/dvb-usb-i2c.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,8 @@ int dvb_usb_pll_init_i2c(struct dvb_frontend *fe)
5252
struct i2c_msg msg = { .addr = d->pll_addr, .flags = 0, .buf = d->pll_init, .len = 4 };
5353
int ret = 0;
5454

55-
/* if there is nothing to initialize */
56-
if (d->pll_init[0] == 0x00 && d->pll_init[1] == 0x00 &&
57-
d->pll_init[2] == 0x00 && d->pll_init[3] == 0x00)
55+
/* if pll_desc is not used */
56+
if (d->pll_desc == NULL)
5857
return 0;
5958

6059
if (d->tuner_pass_ctrl)
@@ -80,6 +79,9 @@ int dvb_usb_pll_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *fep
8079
{
8180
struct dvb_usb_device *d = fe->dvb->priv;
8281

82+
if (d->pll_desc == NULL)
83+
return 0;
84+
8385
deb_pll("pll addr: %x, freq: %d %p\n",d->pll_addr,fep->frequency,d->pll_desc);
8486

8587
b[0] = d->pll_addr << 1;

0 commit comments

Comments
 (0)