30 Oct, 2012
2 commits
-
When disconnect callback is called, each component should wake up
sleepers and check card->shutdown flag for avoiding the endless sleep
blocking the proper resource release.Cc:
Signed-off-by: Takashi Iwai -
For more strict protection for wild disconnections, a refcount is
introduced to the card instance, and let it up/down when an object is
referred via snd_lookup_*() in the open ops.The free-after-last-close check is also changed to check this refcount
instead of the empty list, too.Reported-by: Matthieu CASTET
Cc:
Signed-off-by: Takashi Iwai
07 Sep, 2012
1 commit
-
The SNDRV_CTL_ELEM_ACCESS_VOLATILE bit flag wasn't properly inherited
at creating control elements via snd_ctl_new1().Signed-off-by: Takashi Iwai
13 Mar, 2012
1 commit
-
Fixed a trailing white space error detected
in sound/core/control.c by checkpatch.pl script.Signed-off-by: Jeffrin Jose
Signed-off-by: Takashi Iwai
07 Nov, 2011
1 commit
-
* 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux: (230 commits)
Revert "tracing: Include module.h in define_trace.h"
irq: don't put module.h into irq.h for tracking irqgen modules.
bluetooth: macroize two small inlines to avoid module.h
ip_vs.h: fix implicit use of module_get/module_put from module.h
nf_conntrack.h: fix up fallout from implicit moduleparam.h presence
include: replace linux/module.h with "struct module" wherever possible
include: convert various register fcns to macros to avoid include chaining
crypto.h: remove unused crypto_tfm_alg_modname() inline
uwb.h: fix implicit use of asm/page.h for PAGE_SIZE
pm_runtime.h: explicitly requires notifier.h
linux/dmaengine.h: fix implicit use of bitmap.h and asm/page.h
miscdevice.h: fix up implicit use of lists and types
stop_machine.h: fix implicit use of smp.h for smp_processor_id
of: fix implicit use of errno.h in include/linux/of.h
of_platform.h: delete needless include
acpi: remove module.h include from platform/aclinux.h
miscdevice.h: delete unnecessary inclusion of module.h
device_cgroup.h: delete needless include
net: sch_generic remove redundant use of
net: inet_timewait_sock doesnt need
...Fix up trivial conflicts (other header files, and removal of the ab3550 mfd driver) in
- drivers/media/dvb/frontends/dibx000_common.c
- drivers/media/video/{mt9m111.c,ov6650.c}
- drivers/mfd/ab3550-core.c
- include/linux/dmaengine.h
06 Nov, 2011
1 commit
-
This was introduced by 'ALSA: control: add support for ENUMERATED user
space controls' which adds a u64 variable that gets cast to a pointer:sound/core/control.c: In function 'snd_ctl_elem_init_enum_names':
sound/core/control.c:1089: warning: cast to pointer from integer of different sizeCast to uintptr_t before casting to pointer to avoid the warning.
Signed-off-by: Olof Johansson
[cl: replace long with uintptr_t]
Signed-off-by: Clemens Ladisch
Signed-off-by: Takashi Iwai
01 Nov, 2011
1 commit
-
Lots of sound drivers were getting module.h via the implicit presence
of it in but we are going to clean that up. So
fix up those users now.Signed-off-by: Paul Gortmaker
09 Oct, 2011
1 commit
-
Handling of user control elements was implemented for all types except
ENUMERATED. This type will be needed for the device-specific mixers of
upcoming FireWire drivers.Signed-off-by: Clemens Ladisch
Signed-off-by: Takashi Iwai
24 Aug, 2011
2 commits
-
Suppose the ALSA card already has a number of MAX_USER_CONTROLS controls, and
the user wants to replace one, it should not fail at this condition check.Signed-off-by: Lu Guanqun
Signed-off-by: Takashi Iwai -
remove trailing tab on the line.
Signed-off-by: Lu Guanqun
Signed-off-by: Takashi Iwai
26 May, 2011
1 commit
-
Drop a few variables that are never read.
Signed-off-by: Luca Tettamanti
Signed-off-by: Takashi Iwai
22 Mar, 2011
1 commit
-
Add a function to dynamically replace a given control. If the
control does not already exist, a third parameter is used to determine
whether to actually add that control. This is useful in cases where
downloadable firmware at runtime can add or replace existing controls.
A separate patch needs to be made to allow ALSA Mixer to render the
replaced controls on the fly.Signed-off-by: Dimitris Papastamos
Signed-off-by: Takashi Iwai
18 Mar, 2011
1 commit
11 Mar, 2011
1 commit
-
Added a new API function snd_ctl_activate_id() for activate / inactivate
the control element dynamically.Signed-off-by: Takashi Iwai
Signed-off-by: Mark Brown
08 Mar, 2011
2 commits
-
The return value of snd_ctl_hole_check() is used only to detect whether
to continue the loop in snd_ctl_find_hole() or not, so we can simplify
the code by changing this return type to a boolean. Also rename this
function to better show what it actually does.Signed-off-by: Clemens Ladisch
Signed-off-by: Takashi Iwai -
The purpose of the snd_ctl_hole_check() function is to find conflicts
between the numerical IDs of the new control and those of any existing
controls. However, it would fail to detect an existing control whose
count is smaller than the new control's count and whose interval of IDs
is entirely contained in the interval of the new control's IDs.To fix this, use the correct formula to detect overlapping intervals,
which happens to simplify the condition.This problem was not encountered so far because ALSA does not yet allow
drivers to allocate specific control IDs.Signed-off-by: Clemens Ladisch
Signed-off-by: Takashi Iwai
10 Jan, 2011
1 commit
-
Introduce the helper function snd_ctl_enum_info() to fill out the
elem_info fields for an enumerated control.Signed-off-by: Clemens Ladisch
Signed-off-by: Takashi Iwai
29 Sep, 2010
1 commit
-
The snd_ctl_new() function in sound/core/control.c allocates space for a
snd_kcontrol struct by performing arithmetic operations on a
user-provided size without checking for integer overflow. If a user
provides a large enough size, an overflow will occur, the allocated
chunk will be too small, and a second user-influenced value will be
written repeatedly past the bounds of this chunk. This code is
reachable by unprivileged users who have permission to open
a /dev/snd/controlC* device (on many distros, this is group "audio") via
the SNDRV_CTL_IOCTL_ELEM_ADD and SNDRV_CTL_IOCTL_ELEM_REPLACE ioctls.Signed-off-by: Dan Rosenberg
Cc:
Signed-off-by: Takashi Iwai
13 Apr, 2010
1 commit
-
Set no_llseek to llseek file ops of each sound component (but for hwdep).
This avoids the implicit BKL invocation via generic_file_llseek() used
as default when fops.llseek is NULL.Also call nonseekable_open() at each open ops to ensure the file flags
have no seek bit.Signed-off-by: Takashi Iwai
01 Feb, 2010
2 commits
-
Allow TLV blocks that do not have any values; the smallest possible TLV
is an empty container or one where the information is only in the tag.Signed-off-by: Clemens Ladisch
Signed-off-by: Jaroslav Kysela -
Creating a control with TLV_COMMAND access was not possible because
snd_ctl_new1() forgot to include it in the mask of allowable access
bits.Signed-off-by: Clemens Ladisch
Signed-off-by: Jaroslav Kysela
04 Dec, 2009
1 commit
18 Nov, 2009
1 commit
-
This function is only called from snd_ctl_ioctl() and the file parameter
can never be null so there is no need to check it here.We dereference file at the start of the function:
struct snd_card *card = file->card;
and it confuses static checkers to dereference a pointer before
checking it.Signed-off-by: Dan Carpenter
Signed-off-by: Takashi Iwai
06 Nov, 2009
2 commits
-
Instead of storing the PID number, take a reference to the task's pid
structure. This protects against duplicates due to PID overflows, and
using pid_vnr() ensures that the PID returned by snd_ctl_elem_info() is
correct as seen from the current namespace.Signed-off-by: Clemens Ladisch
Signed-off-by: Takashi Iwai -
We do not need to save the ID of the process that locked a control
because that information is already available in the owner's file data.Signed-off-by: Clemens Ladisch
Signed-off-by: Takashi Iwai
17 Aug, 2009
4 commits
-
Ensure that userspace can remove only user controls. Controls created
by kernel drivers must not be removed because they might be referenced
in calls to snd_ctl_notify().Signed-off-by: Clemens Ladisch
Signed-off-by: Takashi Iwai -
Move the decrementing of the user controls counter from
snd_ctl_elem_remove to snd_ctl_remove_unlocked_id; this saves the
separate locking of the controls semaphore, and therefore removes
a harmless race.Since the purpose of the function is to operate on user controls (the
control being unlocked is just a prerequisite), rename it to
snd_ctl_remove_user_ctl.Signed-off-by: Clemens Ladisch
Signed-off-by: Takashi Iwai -
Use a common exit path to release the mutex and to return a possible
error.Signed-off-by: Clemens Ladisch
Signed-off-by: Takashi Iwai -
Make sure that no user element that has no values can be added.
The check for count>1024 is not needed because the count is checked
later for the individual control types.Signed-off-by: Clemens Ladisch
Signed-off-by: Takashi Iwai
14 Apr, 2009
1 commit
-
Remove open-coded memdup_user().
Signed-off-by: Li Zefan
Signed-off-by: Takashi Iwai
16 Mar, 2009
1 commit
-
Most fasync implementations do something like:
return fasync_helper(...);
But fasync_helper() will return a positive value at times - a feature used
in at least one place. Thus, a number of other drivers do:err = fasync_helper(...);
if (err < 0)
return err;
return 0;In the interests of consistency and more concise code, it makes sense to
map positive return values onto zero where ->fasync() is called.Cc: Al Viro
Signed-off-by: Jonathan Corbet
02 Nov, 2008
1 commit
-
As it is, all instances of ->release() for files that have ->fasync()
need to remember to evict file from fasync lists; forgetting that
creates a hole and we actually have a bunch that *does* forget.So let's keep our lives simple - let __fput() check FASYNC in
file->f_flags and call ->fasync() there if it's been set. And lose that
crap in ->release() instances - leaving it there is still valid, but we
don't have to bother anymore.Signed-off-by: Al Viro
Signed-off-by: Linus Torvalds
29 Oct, 2008
1 commit
-
This is likely to confuse user interfaces since the end of the control
name is interpreted (eg, "Volume", "Switch").Signed-off-by: Mark Brown
Signed-off-by: Takashi Iwai
09 Sep, 2008
1 commit
-
The lock used in snd_ctl_dev_disconnect() should be card->ctl_files_rwlock
for protection of card->ctl_files entries, instead of card->controls_rwsem.Reported-by: Vegard Nossum
Signed-off-by: Takashi Iwai
Signed-off-by: Jaroslav Kysela
13 Aug, 2008
1 commit
-
Kill snd_assert() in sound/core/*, either removed or replaced with
if () with snd_BUG_ON().Signed-off-by: Takashi Iwai
Signed-off-by: Jaroslav Kysela
13 Jun, 2008
1 commit
-
snd_ctl_elem_read() and snd_ctl_elem_write() are no longer used by
any other drivers.Signed-off-by: Takashi Iwai
Signed-off-by: Jaroslav Kysela
01 Feb, 2008
2 commits
-
This header file exists only for some hacks to adapt alsa-driver
tree. It's useless for building in the kernel. Let's move a few
lines in it to sound/core.h and remove it.
With this patch, sound/driver.h isn't removed but has just a single
compile warning to include it. This should be really killed in
future.Signed-off-by: Takashi Iwai
Signed-off-by: Jaroslav Kysela -
This patch removes the indirect control access to the control elements.
The indirect access has never been used and is even broken on 32bit
ioctl wrapper. Let's clean it up.
The pointers still remain in snd_ctl_elem_* structs just to make sure
that the struct size won't change. Once after checking the size
consistency, we can get rid of them, too.Signed-off-by: Takashi Iwai
Signed-off-by: Jaroslav Kysela
23 Oct, 2007
1 commit
-
The lock grabbed in snd_ctl_empty_read_queue() is hardirq-unsafe but we hold
an hardirq-safe one already, so make the &ctl->read_lock also hard-irq-safe.Signed-off-by: Borislav Petkov
Signed-off-by: Takashi Iwai
Signed-off-by: Jaroslav Kysela
16 Oct, 2007
1 commit
-
Signed-off-by: Jaroslav Kysela