[PATCH 3/3] usb-us122l: add qualifier into pointer to userspace

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx>
---
 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);
 
-- 
2.7.4

_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux