diff options
author | Takashi Iwai <tiwai@suse.de> | 2009-04-15 05:24:27 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-04-15 05:24:27 -0400 |
commit | f4723b224d21ff546ac1fea4483094548d529479 (patch) | |
tree | 1257dceebcacbf04d3cd6eabf7ff75cfac2edd96 /sound/isa/wavefront | |
parent | 00610a81df32ea50dba0105078e7369988caef3b (diff) | |
parent | 336500f0305dc1552e8d01a60b409a7db781ca28 (diff) |
Merge branch 'topic/memdup_user' into for-linus
* topic/memdup_user:
ALSA: sound/pci: use memdup_user()
ALSA: sound/usb: use memdup_user()
ALSA: sound/isa: use memdup_user()
ALSA: sound/core: use memdup_user()
Diffstat (limited to 'sound/isa/wavefront')
-rw-r--r-- | sound/isa/wavefront/wavefront_fx.c | 14 | ||||
-rw-r--r-- | sound/isa/wavefront/wavefront_synth.c | 11 |
2 files changed, 10 insertions, 15 deletions
diff --git a/sound/isa/wavefront/wavefront_fx.c b/sound/isa/wavefront/wavefront_fx.c index a4345fc07561..2bb1cee09255 100644 --- a/sound/isa/wavefront/wavefront_fx.c +++ b/sound/isa/wavefront/wavefront_fx.c | |||
@@ -202,15 +202,11 @@ snd_wavefront_fx_ioctl (struct snd_hwdep *sdev, struct file *file, | |||
202 | "> 512 bytes to FX\n"); | 202 | "> 512 bytes to FX\n"); |
203 | return -EIO; | 203 | return -EIO; |
204 | } | 204 | } |
205 | page_data = kmalloc(r.data[2] * sizeof(short), GFP_KERNEL); | 205 | page_data = memdup_user((unsigned char __user *) |
206 | if (!page_data) | 206 | r.data[3], |
207 | return -ENOMEM; | 207 | r.data[2] * sizeof(short)); |
208 | if (copy_from_user (page_data, | 208 | if (IS_ERR(page_data)) |
209 | (unsigned char __user *) r.data[3], | 209 | return PTR_ERR(page_data); |
210 | r.data[2] * sizeof(short))) { | ||
211 | kfree(page_data); | ||
212 | return -EFAULT; | ||
213 | } | ||
214 | pd = page_data; | 210 | pd = page_data; |
215 | } | 211 | } |
216 | 212 | ||
diff --git a/sound/isa/wavefront/wavefront_synth.c b/sound/isa/wavefront/wavefront_synth.c index beb312cca75b..5d4ff48c4345 100644 --- a/sound/isa/wavefront/wavefront_synth.c +++ b/sound/isa/wavefront/wavefront_synth.c | |||
@@ -1664,12 +1664,11 @@ snd_wavefront_synth_ioctl (struct snd_hwdep *hw, struct file *file, | |||
1664 | break; | 1664 | break; |
1665 | 1665 | ||
1666 | case WFCTL_WFCMD: | 1666 | case WFCTL_WFCMD: |
1667 | wc = kmalloc(sizeof(*wc), GFP_KERNEL); | 1667 | wc = memdup_user(argp, sizeof(*wc)); |
1668 | if (! wc) | 1668 | if (IS_ERR(wc)) |
1669 | return -ENOMEM; | 1669 | return PTR_ERR(wc); |
1670 | if (copy_from_user (wc, argp, sizeof (*wc))) | 1670 | |
1671 | err = -EFAULT; | 1671 | if (wavefront_synth_control (acard, wc) < 0) |
1672 | else if (wavefront_synth_control (acard, wc) < 0) | ||
1673 | err = -EIO; | 1672 | err = -EIO; |
1674 | else if (copy_to_user (argp, wc, sizeof (*wc))) | 1673 | else if (copy_to_user (argp, wc, sizeof (*wc))) |
1675 | err = -EFAULT; | 1674 | err = -EFAULT; |