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 <[email protected]>
Signed-off-by: Jesper Juhl <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
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 <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
This patch makes the following needlessly global code static:
- pwc-ctrl.c: pwc_get_leds()
- pwc_preferred_compression
Signed-off-by: Adrian Bunk <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Add support for FusionHDTV 3 Gold (original revision), using the
card definition for FusionHDTV3 Gold-Q
Signed-off-by: Michael Krufky <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
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 <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
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 <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
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 <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
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 <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
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 <[email protected]>
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 <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
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 <[email protected]>
Fix missing $() on variable name in dvb/ttpci/Makefile
Fix AV7110 firmware dependencies so that parallel builds work correctly.
Signed-off-by: Trent Piepho <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Uneeded extern prototype is removed, as the function is
prototyped at media/v4l2-common.h.
Signed-off-by: Trent Piepho <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
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 <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
- 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 <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
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 <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
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 <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
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 <[email protected]>
Signed-off-by: Axel Dyks <[email protected]>
Acked-by: Andreas Oberritter <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
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 <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
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 <[email protected]>
Signed-off-by: Michael Krufky <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
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 <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
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 <[email protected]>
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 <[email protected]>
Several common handling codes were removed. Maybe even more
stuff may be handled at common infrastructure.
Signed-off-by: Mauro Carvalho Chehab <[email protected]>