summaryrefslogtreecommitdiffstats
path: root/drivers/media/usb
diff options
context:
space:
mode:
authorShuah Khan <shuah.kh@samsung.com>2014-07-09 17:36:23 -0300
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-07-26 11:09:40 -0300
commit4db8954afa8f7cad2397cfb9312b3eaf24a05df1 (patch)
tree6cffff3c5cafd8dae1519d1696d47bb23b4f94c1 /drivers/media/usb
parent6eb5e3399e8f45aa191ad21c0556bece8ea559f2 (diff)
downloadop-kernel-dev-4db8954afa8f7cad2397cfb9312b3eaf24a05df1.zip
op-kernel-dev-4db8954afa8f7cad2397cfb9312b3eaf24a05df1.tar.gz
[media] media: em28xx - add error handling for KWORLD dvb_attach failures
Add error hanlding when EM2870_BOARD_KWORLD_A340 dvb_attach() for fe and tuner fail in em28xx_dvb_init(). Signed-off-by: Shuah Khan <shuah.kh@samsung.com> Reviewed-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/usb')
-rw-r--r--drivers/media/usb/em28xx/em28xx-dvb.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c
index 5f90890..2cf34ef 100644
--- a/drivers/media/usb/em28xx/em28xx-dvb.c
+++ b/drivers/media/usb/em28xx/em28xx-dvb.c
@@ -1213,9 +1213,17 @@ static int em28xx_dvb_init(struct em28xx *dev)
dvb->fe[0] = dvb_attach(lgdt3305_attach,
&em2870_lgdt3304_dev,
&dev->i2c_adap[dev->def_i2c_bus]);
- if (dvb->fe[0] != NULL)
- dvb_attach(tda18271_attach, dvb->fe[0], 0x60,
- &dev->i2c_adap[dev->def_i2c_bus], &kworld_a340_config);
+ if (!dvb->fe[0]) {
+ result = -EINVAL;
+ goto out_free;
+ }
+ if (!dvb_attach(tda18271_attach, dvb->fe[0], 0x60,
+ &dev->i2c_adap[dev->def_i2c_bus],
+ &kworld_a340_config)) {
+ dvb_frontend_detach(dvb->fe[0]);
+ result = -EINVAL;
+ goto out_free;
+ }
break;
case EM28174_BOARD_PCTV_290E:
/* set default GPIO0 for LNA, used if GPIOLIB is undefined */
OpenPOWER on IntegriCloud