aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/videobuf-dvb.c
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2011-12-31 05:56:11 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-01-06 09:42:19 -0500
commit5c96ebb7cea790c6ca1b8b70fdea531fb194dabb (patch)
treea60bc1a9e368e49243127eb4b9bab4c8d98186ac /drivers/media/video/videobuf-dvb.c
parent58fae6739f63344d255161900ba12ce7ceb88666 (diff)
[media] videobuf-dvb: avoid spurious ENOMEM when CONFIG_DVB_NET=n
videobuf_dvb_register_bus relies on dvb_net_init to set dvbnet->dvbdev on success, but ever since commit fcc8e7d8c0e2 ("dvb_net: Simplify the code if DVB NET is not defined"), ->dvbdev is left unset when networking support is disabled. Therefore in such configurations videobuf_dvb_register_bus always returns failure, tripping little-tested error handling paths and preventing the device from being initialized and used. Now that dvb_net_init returns a nonzero value on error, we can use that as a more reliable error indication. Do so. Now your card be used with CONFIG_DVB_NET=n, and the kernel will pass on a more useful error code describing what happened when CONFIG_DVB_NET=y but dvb_net_init fails due to resource exhaustion. Reported-by: David Fries <David@Fries.net> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/videobuf-dvb.c')
-rw-r--r--drivers/media/video/videobuf-dvb.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/media/video/videobuf-dvb.c b/drivers/media/video/videobuf-dvb.c
index 3de7c7e4402d..59cb54aa2946 100644
--- a/drivers/media/video/videobuf-dvb.c
+++ b/drivers/media/video/videobuf-dvb.c
@@ -226,9 +226,10 @@ static int videobuf_dvb_register_frontend(struct dvb_adapter *adapter,
226 } 226 }
227 227
228 /* register network adapter */ 228 /* register network adapter */
229 dvb_net_init(adapter, &dvb->net, &dvb->demux.dmx); 229 result = dvb_net_init(adapter, &dvb->net, &dvb->demux.dmx);
230 if (dvb->net.dvbdev == NULL) { 230 if (result < 0) {
231 result = -ENOMEM; 231 printk(KERN_WARNING "%s: dvb_net_init failed (errno = %d)\n",
232 dvb->name, result);
232 goto fail_fe_conn; 233 goto fail_fe_conn;
233 } 234 }
234 return 0; 235 return 0;