Commit 2dbbac33 authored by Jonathan Nieder's avatar Jonathan Nieder Committed by Mauro Carvalho Chehab

[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: default avatarJonathan Nieder <jrnieder@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 01732eba
...@@ -782,7 +782,12 @@ static int __devinit dvb_bt8xx_load_card(struct dvb_bt8xx_card *card, u32 type) ...@@ -782,7 +782,12 @@ static int __devinit dvb_bt8xx_load_card(struct dvb_bt8xx_card *card, u32 type)
goto err_remove_mem_frontend; 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); 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) ...@@ -790,6 +795,8 @@ static int __devinit dvb_bt8xx_load_card(struct dvb_bt8xx_card *card, u32 type)
return 0; return 0;
err_disconnect_frontend:
card->demux.dmx.disconnect_frontend(&card->demux.dmx);
err_remove_mem_frontend: err_remove_mem_frontend:
card->demux.dmx.remove_frontend(&card->demux.dmx, &card->fe_mem); card->demux.dmx.remove_frontend(&card->demux.dmx, &card->fe_mem);
err_remove_hw_frontend: err_remove_hw_frontend:
......
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