Sparse reports below warnings.
us122l.c:393:28: warning: incorrect type in argument 1 (different address spaces) us122l.c:393:28: expected void const [noderef] asn:1*<noident> us122l.c:393:28: got void *<noident>
The first argument for memdup_user() should be a pointer to userspace. In current implementation, a pointer to void is used without __user qualifier.
This commit fixes it.
Fixes: 030a07e4412 ('ALSA: Add USB US122L driver') Signed-off-by: Takashi Sakamoto o-takashi@sakamocchi.jp --- sound/usb/usx2y/us122l.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/usb/usx2y/us122l.c b/sound/usb/usx2y/us122l.c index 36654ac..c578c42 100644 --- a/sound/usb/usx2y/us122l.c +++ b/sound/usb/usx2y/us122l.c @@ -390,7 +390,7 @@ static int usb_stream_hwdep_ioctl(struct snd_hwdep *hw, struct file *file, if (cmd != SNDRV_USB_STREAM_IOCTL_SET_PARAMS) return -ENOTTY;
- cfg = memdup_user((void *)arg, sizeof(*cfg)); + cfg = memdup_user((void __user *)arg, sizeof(*cfg)); if (IS_ERR(cfg)) return PTR_ERR(cfg);