From: Jiri Slaby Date: Wed, 19 Feb 2020 08:49:44 +0000 (+0100) Subject: n_gsm: add missing __user annotations X-Git-Tag: v5.10.7~2949^2~136 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=edd05a735a391df1a8eeee05a5ba1c02ce41b369;p=platform%2Fkernel%2Flinux-rpi.git n_gsm: add missing __user annotations sparse warns about incorrect types: n_gsm.c:2638:35: warning: incorrect type in argument 1 (different address spaces) n_gsm.c:2638:35: expected void [noderef] *to n_gsm.c:2638:35: got void * The ioctl handler casts its `arg' to (void *) without __user. Add that. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20200219084949.28074-5-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c index 82e3d88..d866884 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -2638,11 +2638,11 @@ static int gsmld_ioctl(struct tty_struct *tty, struct file *file, switch (cmd) { case GSMIOC_GETCONF: gsm_copy_config_values(gsm, &c); - if (copy_to_user((void *)arg, &c, sizeof(c))) + if (copy_to_user((void __user *)arg, &c, sizeof(c))) return -EFAULT; return 0; case GSMIOC_SETCONF: - if (copy_from_user(&c, (void *)arg, sizeof(c))) + if (copy_from_user(&c, (void __user *)arg, sizeof(c))) return -EFAULT; return gsm_config(gsm, &c); case GSMIOC_GETFIRST: