Commit 8a08ef08 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

media: xc4000: don't ignore error if hwmodel fails

If, for some reason, reading the hwmodel register on
xc4000 fails, it will cause the following logig to
use a random value, as reported by smatch:

	drivers/media/tuners/xc4000.c:1047 check_firmware() error: uninitialized symbol 'hwmodel'.
	drivers/media/tuners/xc4000.c:1060 check_firmware() error: uninitialized symbol 'hwmodel'.
	drivers/media/tuners/xc4000.c:1064 check_firmware() error: uninitialized symbol 'hwmodel'.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 02d73243
......@@ -1036,7 +1036,10 @@ static int check_firmware(struct dvb_frontend *fe, unsigned int type,
dprintk(1, "load scode failed %d\n", rc);
check_device:
rc = xc4000_readreg(priv, XREG_PRODUCT_ID, &hwmodel);
if (xc4000_readreg(priv, XREG_PRODUCT_ID, &hwmodel) < 0) {
printk(KERN_ERR "Unable to read tuner registers.\n");
goto fail;
}
if (xc_get_version(priv, &hw_major, &hw_minor, &fw_major,
&fw_minor) != 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment