aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2011-12-31 06:19:56 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-01-06 09:51:26 -0500
commitf1d99f39fbd0218b8f8f6548e5522cbc2124f949 (patch)
treed393ef7f4fe3d9be5f60b8a78797a8c7f3fb2a7b
parent60826f02695476ded2fecc67949c83dc4b49def7 (diff)
[media] firedtv: handle errors from dvb_net_init
It is not common for dvb_net_init to fail, but after the patch "dvb_net_init: return -errno on error" it can fail due to running out of memory. Handle this. From an audit of dvb_net_init callers. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Reviewed-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/dvb/firewire/firedtv-dvb.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/media/dvb/firewire/firedtv-dvb.c b/drivers/media/dvb/firewire/firedtv-dvb.c
index fd8bbbfa5c59..eb7496eab130 100644
--- a/drivers/media/dvb/firewire/firedtv-dvb.c
+++ b/drivers/media/dvb/firewire/firedtv-dvb.c
@@ -203,7 +203,9 @@ int fdtv_dvb_register(struct firedtv *fdtv, const char *name)
203 if (err) 203 if (err)
204 goto fail_rem_frontend; 204 goto fail_rem_frontend;
205 205
206 dvb_net_init(&fdtv->adapter, &fdtv->dvbnet, &fdtv->demux.dmx); 206 err = dvb_net_init(&fdtv->adapter, &fdtv->dvbnet, &fdtv->demux.dmx);
207 if (err)
208 goto fail_disconnect_frontend;
207 209
208 fdtv_frontend_init(fdtv, name); 210 fdtv_frontend_init(fdtv, name);
209 err = dvb_register_frontend(&fdtv->adapter, &fdtv->fe); 211 err = dvb_register_frontend(&fdtv->adapter, &fdtv->fe);
@@ -218,6 +220,7 @@ int fdtv_dvb_register(struct firedtv *fdtv, const char *name)
218 220
219fail_net_release: 221fail_net_release:
220 dvb_net_release(&fdtv->dvbnet); 222 dvb_net_release(&fdtv->dvbnet);
223fail_disconnect_frontend:
221 fdtv->demux.dmx.close(&fdtv->demux.dmx); 224 fdtv->demux.dmx.close(&fdtv->demux.dmx);
222fail_rem_frontend: 225fail_rem_frontend:
223 fdtv->demux.dmx.remove_frontend(&fdtv->demux.dmx, &fdtv->frontend); 226 fdtv->demux.dmx.remove_frontend(&fdtv->demux.dmx, &fdtv->frontend);