Skip to content

Commit

Permalink
[media] dvb-bt8xx: handle errors from dvb_net_init
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jonathan Nieder authored and Mauro Carvalho Chehab committed Jan 6, 2012
1 parent 01732eb commit 2dbbac3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion drivers/media/dvb/bt8xx/dvb-bt8xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -782,14 +782,21 @@ 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);

frontend_init(card, 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:
Expand Down

0 comments on commit 2dbbac3

Please sign in to comment.