Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 143377
b: refs/heads/master
c: 68425ad
h: refs/heads/master
i:
  143375: f1a245b
v: v3
  • Loading branch information
Li Zefan authored and Takashi Iwai committed Apr 14, 2009
1 parent 2a78fac commit 7114e0e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 25 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: ef44a1ec6eeef189998f84e7230e1d3535b01074
refs/heads/master: 68425adcc419bfe90776f59e66b8c4cdb6e1b1f3
19 changes: 10 additions & 9 deletions trunk/sound/isa/sb/sb16_csp.c
Original file line number Diff line number Diff line change
Expand Up @@ -684,15 +684,16 @@ static int snd_sb_csp_load(struct snd_sb_csp * p, const unsigned char *buf, int

static int snd_sb_csp_load_user(struct snd_sb_csp * p, const unsigned char __user *buf, int size, int load_flags)
{
int err = -ENOMEM;
unsigned char *kbuf = kmalloc(size, GFP_KERNEL);
if (kbuf) {
if (copy_from_user(kbuf, buf, size))
err = -EFAULT;
else
err = snd_sb_csp_load(p, kbuf, size, load_flags);
kfree(kbuf);
}
int err;
unsigned char *kbuf;

kbuf = memdup_user(buf, size);
if (IS_ERR(kbuf))
return PTR_ERR(kbuf);

err = snd_sb_csp_load(p, kbuf, size, load_flags);

kfree(kbuf);
return err;
}

Expand Down
14 changes: 5 additions & 9 deletions trunk/sound/isa/wavefront/wavefront_fx.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,15 +210,11 @@ snd_wavefront_fx_ioctl (struct snd_hwdep *sdev, struct file *file,
"> 512 bytes to FX\n");
return -EIO;
}
page_data = kmalloc(r.data[2] * sizeof(short), GFP_KERNEL);
if (!page_data)
return -ENOMEM;
if (copy_from_user (page_data,
(unsigned char __user *) r.data[3],
r.data[2] * sizeof(short))) {
kfree(page_data);
return -EFAULT;
}
page_data = memdup_user((unsigned char __user *)
r.data[3],
r.data[2] * sizeof(short));
if (IS_ERR(page_data))
return PTR_ERR(page_data);
pd = page_data;
}

Expand Down
11 changes: 5 additions & 6 deletions trunk/sound/isa/wavefront/wavefront_synth.c
Original file line number Diff line number Diff line change
Expand Up @@ -1664,12 +1664,11 @@ snd_wavefront_synth_ioctl (struct snd_hwdep *hw, struct file *file,
break;

case WFCTL_WFCMD:
wc = kmalloc(sizeof(*wc), GFP_KERNEL);
if (! wc)
return -ENOMEM;
if (copy_from_user (wc, argp, sizeof (*wc)))
err = -EFAULT;
else if (wavefront_synth_control (acard, wc) < 0)
wc = memdup_user(argp, sizeof(*wc));
if (IS_ERR(wc))
return PTR_ERR(wc);

if (wavefront_synth_control (acard, wc) < 0)
err = -EIO;
else if (copy_to_user (argp, wc, sizeof (*wc)))
err = -EFAULT;
Expand Down

0 comments on commit 7114e0e

Please sign in to comment.