The coverity checker detected a use-after-free error in
drivers/media/video/cpia2/cpia2_v4l.c::cpia2_close() (coverity
error #1281).
What happens is that we lock cam->busy_lock, then proceed to free
resources, and in the case of (--cam->open_count == 0) we finish off by
doing a kfree(cam) and then at the end of the function we do a
mutex_unlock(&cam->busy_lock) which will explode since it'll dereference
the free'd `cam' :
...
mutex_lock(&cam->busy_lock);
...
if (--cam->open_count == 0) {
...
if (!cam->present) {
video_unregister_device(dev);
kfree(cam);
}
}
mutex_unlock(&cam->busy_lock); <--- PROBLEM, cam no longer around.
...
Since this only happens in the case of open_count going down to zero I
don't see a problem with just releasing the mutex after unregistering the
device and just before the kfree(). In this case there is nothing around
that we can race against; we are in the release method, open_count is zero,
(!cam->present) and the device has just been unregistered, so letting go of
the mutex at this point looks safe to me.
Patch below to implement that solution.
Acked-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
clear EN_I2SIN_ENABLE bit for ASUS PVR-416 to enable audio
streaming in both raw video and blackbird mpeg encoder modes.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This patch makes the following needlessly global code static:
- pwc-ctrl.c: pwc_get_leds()
- pwc_preferred_compression
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Make two needlessly global functions static.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Add support for FusionHDTV 3 Gold (original revision), using the
card definition for FusionHDTV3 Gold-Q
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
There's a call at cx88-tvaudio to reset DMA sound on channel change; that
call was killing cx88-alsa whenever the channel was changed, resulting
in no sound. Remove those calls if cx88-alsa is selected to be compiled.
Signed-off-by: Ricardo Cerqueira <v4l@cerqueira.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
cx88-alsa was resetting the card on load, causing the IRQ IR handler
to go away (maybe others, too). There's no actual need to reset the
card, though, so that line was removed
Signed-off-by: Ricardo Cerqueira <v4l@cerqueira.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
There was an unmasked bit in the keycodes that was causing random
behaviour (the code could be N or N+1). Masked that bit now.
Signed-off-by: Ricardo Cerqueira <v4l@cerqueira.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This Kconfig description is incorrect, due to a previous merge a while back.
CONFIG_SAA711X builds module saa7115, which is the newer module, and is
not obsoleted.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
- fix missing line in VSB snr decoding logic for lgdt3303
Signed-off-by: Mac Michaels <wmichaels@earthlink.net>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Ovcamship is used only on some USB webcams (OV511 and W9968CF)
Bettet to leave this item just after those webcams.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Add detection for the LifeView3000 NTSC model (right now the PAL version is
the only one in there, which is sort of annoying for me living in the US
and all.. sigh...)
This is one of those things that I like to classify "as a works for me so
take it or leave it" :-) . Not that worried because its an $18 video
capture card that didn't look it was selling to well in the US, but then
again who knows.
The documentation needs updating too I bet but its behind anyways usually
to what is in the code.
Signed-off-by: Zac Bowling <zac@zacbowling.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Make life easier for distro guys, by removing the need of including
at the userspace header.
Also, linux/compiler.h is not needed at userspace.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Fix missing $() on variable name in dvb/ttpci/Makefile
Fix AV7110 firmware dependencies so that parallel builds work correctly.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Uneeded extern prototype is removed, as the function is
prototyped at media/v4l2-common.h.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This patch splits up dvb_pll_attach and isl6421_attach function calls
such that the lines do not exceed 80 columns. This patch is purely cosmetic,
with no functional change at all.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
- moved CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL frontend_attach code up
to share the #ifdef block with CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This patch adds support for a newer version of this device
using the zl10353 frontend instead of the mt352 frontend.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This patch adds support for a newer version of this device
using the zl10353 frontend instead of the mt352 frontend.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
cinergyt2_poll()" shouldn't return (POLLIN | POLLRDNORM | POLLPRI) when
there are no pending events. User space programs that do non-bocking IO
using "select()" and/or "poll()" would otherwise produce high system load.
Acked-by: Andreas Oberritter <obi@linuxtv.org>
Signed-off-by: Axel Dyks <xl@xlsigned.net>
Acked-by: Andreas Oberritter <obi@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
The description of the card has been updated to it's full name/model.
The tuner has also been switched to a more compatible one (radio
wasn't working, now it is)
Signed-off-by: Ricardo Cerqueira <v4l@cerqueira.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This patch adds support for Satelco EasyWatch DVB-S light card,
a clone of the KNC 1, with PCI subsystem ID 1894:001e
Signed-off-by: Lothar Englisch <Lothar.Englisch@lycos.de>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
The zoran driver uses strncpy() in an unsafe way. This patch uses the proper
sizeof()-1 size parameter. Since all strncpy() targets are initialised with
memset() the trailing '\0' is already set. Where std->name was the target for
the strncpy() we overwrote 8 Bytes of the std structure with zeros.
Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
The videodev.h and videodev2.h describe the public API for V4L and V4L2.
It shouldn't have there any kernel-specific stuff. Those were moved to
v4l2-dev.h.
This patch removes some uneeded headers and include v4l2-common.h on all
V4L driver. This header includes device implementation of V4L2 API provided
on v4l2-dev.h as well as V4L2 internal ioctls that provides connections
between master driver and its i2c devices.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Sub-carrier frequency for PAL/M is slicely different than NTSC/M.
Without this patch, colors don't work on PAL/M.
Setting method also improved to allow other video standards to be included.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Several common handling codes were removed. Maybe even more
stuff may be handled at common infrastructure.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Videodev now is capable of better handling V4L2 api, by
processing V4L2 ioctls and using callbacks to the driver.
The drivers should be migrated to the newer way and the older
one will be obsoleted soon.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>