diff options
-rw-r--r-- | sound/usb/usx2y/usX2Yhwdep.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/sound/usb/usx2y/usX2Yhwdep.c b/sound/usb/usx2y/usX2Yhwdep.c index f4b3cda412fc..2bbcf4af06dd 100644 --- a/sound/usb/usx2y/usX2Yhwdep.c +++ b/sound/usb/usx2y/usX2Yhwdep.c | |||
@@ -198,24 +198,22 @@ static int snd_usX2Y_hwdep_dsp_load(struct snd_hwdep *hw, | |||
198 | struct snd_hwdep_dsp_image *dsp) | 198 | struct snd_hwdep_dsp_image *dsp) |
199 | { | 199 | { |
200 | struct usX2Ydev *priv = hw->private_data; | 200 | struct usX2Ydev *priv = hw->private_data; |
201 | int lret, err = -EINVAL; | 201 | struct usb_device* dev = priv->dev; |
202 | snd_printdd( "dsp_load %s\n", dsp->name); | 202 | int lret, err; |
203 | char *buf; | ||
203 | 204 | ||
204 | if (access_ok(VERIFY_READ, dsp->image, dsp->length)) { | 205 | snd_printdd( "dsp_load %s\n", dsp->name); |
205 | struct usb_device* dev = priv->dev; | ||
206 | char *buf; | ||
207 | 206 | ||
208 | buf = memdup_user(dsp->image, dsp->length); | 207 | buf = memdup_user(dsp->image, dsp->length); |
209 | if (IS_ERR(buf)) | 208 | if (IS_ERR(buf)) |
210 | return PTR_ERR(buf); | 209 | return PTR_ERR(buf); |
211 | 210 | ||
212 | err = usb_set_interface(dev, 0, 1); | 211 | err = usb_set_interface(dev, 0, 1); |
213 | if (err) | 212 | if (err) |
214 | snd_printk(KERN_ERR "usb_set_interface error \n"); | 213 | snd_printk(KERN_ERR "usb_set_interface error \n"); |
215 | else | 214 | else |
216 | err = usb_bulk_msg(dev, usb_sndbulkpipe(dev, 2), buf, dsp->length, &lret, 6000); | 215 | err = usb_bulk_msg(dev, usb_sndbulkpipe(dev, 2), buf, dsp->length, &lret, 6000); |
217 | kfree(buf); | 216 | kfree(buf); |
218 | } | ||
219 | if (err) | 217 | if (err) |
220 | return err; | 218 | return err; |
221 | if (dsp->index == 1) { | 219 | if (dsp->index == 1) { |