diff options
author | Takashi Iwai <tiwai@suse.de> | 2009-05-04 16:05:23 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-05-04 16:05:23 +0200 |
commit | 8560b9321f9050968f393ce1ec67e47c1a0bd5cf (patch) | |
tree | 658ebb20e4fd5dee840f27103b59da367ff473b1 /sound/usb/usx2y/usX2Yhwdep.c | |
parent | 72e31981a4e91f84c5b5e8994f5d25b1cf22b6cf (diff) | |
parent | 6574612fbb34c63117581e68f2231ddce027e41e (diff) |
Merge branch 'fix/asoc' into topic/asoc
Diffstat (limited to 'sound/usb/usx2y/usX2Yhwdep.c')
-rw-r--r-- | sound/usb/usx2y/usX2Yhwdep.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/sound/usb/usx2y/usX2Yhwdep.c b/sound/usb/usx2y/usX2Yhwdep.c index 4af8740db71..f3d8f71265d 100644 --- a/sound/usb/usx2y/usX2Yhwdep.c +++ b/sound/usb/usx2y/usX2Yhwdep.c @@ -203,13 +203,12 @@ static int snd_usX2Y_hwdep_dsp_load(struct snd_hwdep *hw, if (access_ok(VERIFY_READ, dsp->image, dsp->length)) { struct usb_device* dev = priv->chip.dev; - char *buf = kmalloc(dsp->length, GFP_KERNEL); - if (!buf) - return -ENOMEM; - if (copy_from_user(buf, dsp->image, dsp->length)) { - kfree(buf); - return -EFAULT; - } + char *buf; + + buf = memdup_user(dsp->image, dsp->length); + if (IS_ERR(buf)) + return PTR_ERR(buf); + err = usb_set_interface(dev, 0, 1); if (err) snd_printk(KERN_ERR "usb_set_interface error \n"); |