diff options
author | Devin Heitmueller <devin.heitmueller@gmail.com> | 2008-06-10 12:34:35 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-06-26 15:58:44 -0300 |
commit | df619181631217e3166bb6c7538f981e0272617f (patch) | |
tree | c35f999f9a557490a997cd57eebe403216993ca5 /drivers/media/video/em28xx/em28xx-dvb.c | |
parent | 1a78db826973b9fa658d72291ec2007889e2faf7 (diff) | |
download | kernel_samsung_smdk4412-df619181631217e3166bb6c7538f981e0272617f.zip kernel_samsung_smdk4412-df619181631217e3166bb6c7538f981e0272617f.tar.gz kernel_samsung_smdk4412-df619181631217e3166bb6c7538f981e0272617f.tar.bz2 |
V4L/DVB (8017): Ensure em28xx extensions only get run against devs that support them
em28xx-audio.c
em28xx-dvb.c
- Em28xx extensions should ensure they are being only loaded against devices
that support them. Deals with case where there are multiple em28xx
devices, some of which have DVB (or ALSA) support and some do not.
Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/em28xx/em28xx-dvb.c')
-rw-r--r-- | drivers/media/video/em28xx/em28xx-dvb.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/media/video/em28xx/em28xx-dvb.c b/drivers/media/video/em28xx/em28xx-dvb.c index 8cf4983..0b2333e 100644 --- a/drivers/media/video/em28xx/em28xx-dvb.c +++ b/drivers/media/video/em28xx/em28xx-dvb.c @@ -382,6 +382,11 @@ static int dvb_init(struct em28xx *dev) int result = 0; struct em28xx_dvb *dvb; + if (!dev->has_dvb) { + /* This device does not support the extension */ + return 0; + } + dvb = kzalloc(sizeof(struct em28xx_dvb), GFP_KERNEL); if (dvb == NULL) { @@ -444,6 +449,11 @@ out_free: static int dvb_fini(struct em28xx *dev) { + if (!dev->has_dvb) { + /* This device does not support the extension */ + return 0; + } + if (dev->dvb) { unregister_dvb(dev->dvb); dev->dvb = NULL; |