diff options
author | Jonathan Nieder <jrnieder@gmail.com> | 2011-12-31 06:04:25 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-01-06 09:46:58 -0500 |
commit | 01732ebaac701638aab5d7b63ea2ee14452afd33 (patch) | |
tree | 788fd432e9bfe8d84f94defaccac9f305737c369 /drivers/media | |
parent | 42702de248d9edff22efe25e275c211a5bb80baf (diff) |
[media] flexcop: handle errors from dvb_net_init
Bail out if dvb_net_init encounters an error (for example an
out-of-memory condition), now that it reports them.
[mchehab@redhat.com: CodingStyle fix: don't use "if ((ret = foo()) < 0)"]
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/dvb/b2c2/flexcop.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/media/dvb/b2c2/flexcop.c b/drivers/media/dvb/b2c2/flexcop.c index 2df1b0214dcd..4d3caca466fd 100644 --- a/drivers/media/dvb/b2c2/flexcop.c +++ b/drivers/media/dvb/b2c2/flexcop.c | |||
@@ -117,11 +117,17 @@ static int flexcop_dvb_init(struct flexcop_device *fc) | |||
117 | goto err_connect_frontend; | 117 | goto err_connect_frontend; |
118 | } | 118 | } |
119 | 119 | ||
120 | dvb_net_init(&fc->dvb_adapter, &fc->dvbnet, &fc->demux.dmx); | 120 | ret = dvb_net_init(&fc->dvb_adapter, &fc->dvbnet, &fc->demux.dmx); |
121 | if (ret < 0) { | ||
122 | err("dvb_net_init failed: error %d", ret); | ||
123 | goto err_net; | ||
124 | } | ||
121 | 125 | ||
122 | fc->init_state |= FC_STATE_DVB_INIT; | 126 | fc->init_state |= FC_STATE_DVB_INIT; |
123 | return 0; | 127 | return 0; |
124 | 128 | ||
129 | err_net: | ||
130 | fc->demux.dmx.disconnect_frontend(&fc->demux.dmx); | ||
125 | err_connect_frontend: | 131 | err_connect_frontend: |
126 | fc->demux.dmx.remove_frontend(&fc->demux.dmx, &fc->mem_frontend); | 132 | fc->demux.dmx.remove_frontend(&fc->demux.dmx, &fc->mem_frontend); |
127 | err_dmx_add_mem_frontend: | 133 | err_dmx_add_mem_frontend: |