aboutsummaryrefslogtreecommitdiff
path: root/sound/core/control_compat.c
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-02-23 21:16:27 -0500
committerJeff Garzik <jeff@garzik.org>2006-02-23 21:16:27 -0500
commit7b0386921db20add25afd8678ed34a9253e512fc (patch)
tree8c6b888b76211e38e6c1c3006553dc4b2b24c75e /sound/core/control_compat.c
parentc5580a7ecb859c6821dd761c95fa150ec7695ae1 (diff)
parent22fe472cb430ce45c4fb9b6d13060dd724d6dbc8 (diff)
Merge branch 'upstream-fixes'
Diffstat (limited to 'sound/core/control_compat.c')
-rw-r--r--sound/core/control_compat.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/sound/core/control_compat.c b/sound/core/control_compat.c
index 418c6d4e5da..a529b62972b 100644
--- a/sound/core/control_compat.c
+++ b/sound/core/control_compat.c
@@ -167,7 +167,7 @@ static int get_ctl_type(struct snd_card *card, struct snd_ctl_elem_id *id,
int *countp)
{
struct snd_kcontrol *kctl;
- struct snd_ctl_elem_info info;
+ struct snd_ctl_elem_info *info;
int err;
down_read(&card->controls_rwsem);
@@ -176,13 +176,19 @@ static int get_ctl_type(struct snd_card *card, struct snd_ctl_elem_id *id,
up_read(&card->controls_rwsem);
return -ENXIO;
}
- info.id = *id;
- err = kctl->info(kctl, &info);
+ info = kzalloc(sizeof(*info), GFP_KERNEL);
+ if (info == NULL) {
+ up_read(&card->controls_rwsem);
+ return -ENOMEM;
+ }
+ info->id = *id;
+ err = kctl->info(kctl, info);
up_read(&card->controls_rwsem);
if (err >= 0) {
- err = info.type;
- *countp = info.count;
+ err = info->type;
+ *countp = info->count;
}
+ kfree(info);
return err;
}