summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2011-12-31 08:06:37 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-01-06 12:49:18 -0200
commit2dbbac330621e83d00e904d1139b62e7b360f946 (patch)
treecb2a7f0e508b6458e7a583b8a414e5d17b0b4c99
parent01732ebaac701638aab5d7b63ea2ee14452afd33 (diff)
downloadlinux-2dbbac330621e83d00e904d1139b62e7b360f946.tar.bz2
[media] dvb-bt8xx: handle errors from dvb_net_init
Clean up and error out if dvb_net_init fails (for example when running out of memory). From an audit of dvb_net_init callers, now that dvb_net_init has learned to return a nonzero value from time to time. [mchehab.redhat.com: codingstyle fix: printk() should include KERN_ facility level] Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/dvb/bt8xx/dvb-bt8xx.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/drivers/media/dvb/bt8xx/dvb-bt8xx.c
index 1952f6bfc90e..8a31349dd7d5 100644
--- a/drivers/media/dvb/bt8xx/dvb-bt8xx.c
+++ b/drivers/media/dvb/bt8xx/dvb-bt8xx.c
@@ -782,7 +782,12 @@ static int __devinit dvb_bt8xx_load_card(struct dvb_bt8xx_card *card, u32 type)
goto err_remove_mem_frontend;
}
- dvb_net_init(&card->dvb_adapter, &card->dvbnet, &card->demux.dmx);
+ result = dvb_net_init(&card->dvb_adapter, &card->dvbnet, &card->demux.dmx);
+ if (result < 0) {
+ printk(KERN_ERR,
+ "dvb_bt8xx: dvb_net_init failed (errno = %d)\n", result);
+ goto err_disconnect_frontend;
+ }
tasklet_init(&card->bt->tasklet, dvb_bt8xx_task, (unsigned long) card);
@@ -790,6 +795,8 @@ static int __devinit dvb_bt8xx_load_card(struct dvb_bt8xx_card *card, u32 type)
return 0;
+err_disconnect_frontend:
+ card->demux.dmx.disconnect_frontend(&card->demux.dmx);
err_remove_mem_frontend:
card->demux.dmx.remove_frontend(&card->demux.dmx, &card->fe_mem);
err_remove_hw_frontend: