Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 221948
b: refs/heads/master
c: 3b97eed
h: refs/heads/master
v: v3
  • Loading branch information
Dan Carpenter authored and Greg Kroah-Hartman committed Nov 9, 2010
1 parent 18b1d31 commit 9cf4508
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 37 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ea07a9f2557b8ea99a0cdd778a5d94a7495bb049
refs/heads/master: 3b97eed201376db6c4487fc846022eb4ffa7e1f9
65 changes: 29 additions & 36 deletions trunk/drivers/staging/intel_sst/intel_sst_app_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -885,41 +885,39 @@ long intel_sst_ioctl(struct file *file_ptr, unsigned int cmd, unsigned long arg)
break;
}
case _IOC_NR(SNDRV_SST_SET_VOL): {
struct snd_sst_vol *set_vol;
struct snd_sst_vol *rec_vol = (struct snd_sst_vol *)arg;
struct snd_sst_vol set_vol;

if (copy_from_user(&set_vol, (void __user *)arg,
sizeof(set_vol))) {
pr_debug("sst: copy failed\n");
retval = -EFAULT;
break;
}
pr_debug("sst: SET_VOLUME recieved for %d!\n",
rec_vol->stream_id);
if (minor == STREAM_MODULE && rec_vol->stream_id == 0) {
set_vol.stream_id);
if (minor == STREAM_MODULE && set_vol.stream_id == 0) {
pr_debug("sst: invalid operation!\n");
retval = -EPERM;
break;
}
set_vol = kzalloc(sizeof(*set_vol), GFP_ATOMIC);
if (!set_vol) {
pr_debug("sst: mem allocation failed\n");
retval = -ENOMEM;
break;
}
if (copy_from_user(set_vol, rec_vol, sizeof(*set_vol))) {
pr_debug("sst: copy failed\n");
retval = -EFAULT;
break;
}
retval = sst_set_vol(set_vol);
kfree(set_vol);
retval = sst_set_vol(&set_vol);
break;
}
case _IOC_NR(SNDRV_SST_GET_VOL): {
struct snd_sst_vol *rec_vol = (struct snd_sst_vol *)arg;
struct snd_sst_vol get_vol;

if (copy_from_user(&get_vol, (void __user *)arg,
sizeof(get_vol))) {
retval = -EFAULT;
break;
}
pr_debug("sst: IOCTL_GET_VOLUME recieved for stream = %d!\n",
rec_vol->stream_id);
if (minor == STREAM_MODULE && rec_vol->stream_id == 0) {
get_vol.stream_id);
if (minor == STREAM_MODULE && get_vol.stream_id == 0) {
pr_debug("sst: invalid operation!\n");
retval = -EPERM;
break;
}
get_vol.stream_id = rec_vol->stream_id;
retval = sst_get_vol(&get_vol);
if (retval) {
retval = -EIO;
Expand All @@ -938,25 +936,20 @@ long intel_sst_ioctl(struct file *file_ptr, unsigned int cmd, unsigned long arg)
}

case _IOC_NR(SNDRV_SST_MUTE): {
struct snd_sst_mute *set_mute;
struct snd_sst_vol *rec_mute = (struct snd_sst_vol *)arg;
pr_debug("sst: SNDRV_SST_SET_VOLUME recieved for %d!\n",
rec_mute->stream_id);
if (minor == STREAM_MODULE && rec_mute->stream_id == 0) {
retval = -EPERM;
break;
}
set_mute = kzalloc(sizeof(*set_mute), GFP_ATOMIC);
if (!set_mute) {
retval = -ENOMEM;
struct snd_sst_mute set_mute;

if (copy_from_user(&set_mute, (void __user *)arg,
sizeof(set_mute))) {
retval = -EFAULT;
break;
}
if (copy_from_user(set_mute, rec_mute, sizeof(*set_mute))) {
retval = -EFAULT;
pr_debug("sst: SNDRV_SST_SET_VOLUME recieved for %d!\n",
set_mute.stream_id);
if (minor == STREAM_MODULE && set_mute.stream_id == 0) {
retval = -EPERM;
break;
}
retval = sst_set_mute(set_mute);
kfree(set_mute);
retval = sst_set_mute(&set_mute);
break;
}
case _IOC_NR(SNDRV_SST_STREAM_GET_PARAMS): {
Expand Down

0 comments on commit 9cf4508

Please sign in to comment.