projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'fix/usx2y' into for-linus
[firefly-linux-kernel-4.4.55.git]
/
sound
/
usb
/
usx2y
/
us122l.c
diff --git
a/sound/usb/usx2y/us122l.c
b/sound/usb/usx2y/us122l.c
index 463f3ffe3fb97abb4214c36a2f9eb89713f86969..a5aae9d67f31707e585de8de10689d8099df5f1c 100644
(file)
--- a/
sound/usb/usx2y/us122l.c
+++ b/
sound/usb/usx2y/us122l.c
@@
-349,14
+349,10
@@
static int usb_stream_hwdep_ioctl(struct snd_hwdep *hw, struct file *file,
if (cmd != SNDRV_USB_STREAM_IOCTL_SET_PARAMS)
return -ENOTTY;
if (cmd != SNDRV_USB_STREAM_IOCTL_SET_PARAMS)
return -ENOTTY;
- cfg =
kmalloc(sizeof(*cfg), GFP_KERNEL
);
- if (
!cfg
)
- return
-ENOMEM
;
+ cfg =
memdup_user((void *)arg, sizeof(*cfg)
);
+ if (
IS_ERR(cfg)
)
+ return
PTR_ERR(cfg)
;
- if (copy_from_user(cfg, (void *)arg, sizeof(*cfg))) {
- err = -EFAULT;
- goto free;
- }
if (cfg->version != USB_STREAM_INTERFACE_VERSION) {
err = -ENXIO;
goto free;
if (cfg->version != USB_STREAM_INTERFACE_VERSION) {
err = -ENXIO;
goto free;