diff mbox series

MIPS: sibyte: Add missing __user annotations in sb_tbprof.c

Message ID 20220217142117.107976-1-tsbogend@alpha.franken.de (mailing list archive)
State Accepted
Commit 10242464e506bc8038a7d91943a7b36a6afbcee3
Headers show
Series MIPS: sibyte: Add missing __user annotations in sb_tbprof.c | expand

Commit Message

Thomas Bogendoerfer Feb. 17, 2022, 2:21 p.m. UTC
Add missing __user annotations to fix sparse errors.

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
---
 arch/mips/sibyte/common/sb_tbprof.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Thomas Bogendoerfer Feb. 22, 2022, 8:46 a.m. UTC | #1
On Thu, Feb 17, 2022 at 03:21:17PM +0100, Thomas Bogendoerfer wrote:
> Add missing __user annotations to fix sparse errors.
> 
> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> ---
>  arch/mips/sibyte/common/sb_tbprof.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/mips/sibyte/common/sb_tbprof.c b/arch/mips/sibyte/common/sb_tbprof.c
> index f80d7a710333..bc47681e825a 100644
> --- a/arch/mips/sibyte/common/sb_tbprof.c
> +++ b/arch/mips/sibyte/common/sb_tbprof.c
> @@ -437,13 +437,13 @@ static int sbprof_tb_release(struct inode *inode, struct file *filp)
>  	return 0;
>  }
>  
> -static ssize_t sbprof_tb_read(struct file *filp, char *buf,
> +static ssize_t sbprof_tb_read(struct file *filp, char __user *buf,
>  			      size_t size, loff_t *offp)
>  {
>  	int cur_sample, sample_off, cur_count, sample_left;
>  	char *src;
>  	int   count   =	 0;
> -	char *dest    =	 buf;
> +	char __user *dest    =	 buf;
>  	long  cur_off = *offp;
>  
>  	if (!access_ok(buf, size))
> @@ -512,7 +512,7 @@ static long sbprof_tb_ioctl(struct file *filp,
>  		if (err)
>  			break;
>  
> -		err = put_user(TB_FULL, (int *) arg);
> +		err = put_user(TB_FULL, (int __user *) arg);
>  		break;
>  	}
>  
> -- 
> 2.29.2

applied to mips-next.

Thomas.
diff mbox series

Patch

diff --git a/arch/mips/sibyte/common/sb_tbprof.c b/arch/mips/sibyte/common/sb_tbprof.c
index f80d7a710333..bc47681e825a 100644
--- a/arch/mips/sibyte/common/sb_tbprof.c
+++ b/arch/mips/sibyte/common/sb_tbprof.c
@@ -437,13 +437,13 @@  static int sbprof_tb_release(struct inode *inode, struct file *filp)
 	return 0;
 }
 
-static ssize_t sbprof_tb_read(struct file *filp, char *buf,
+static ssize_t sbprof_tb_read(struct file *filp, char __user *buf,
 			      size_t size, loff_t *offp)
 {
 	int cur_sample, sample_off, cur_count, sample_left;
 	char *src;
 	int   count   =	 0;
-	char *dest    =	 buf;
+	char __user *dest    =	 buf;
 	long  cur_off = *offp;
 
 	if (!access_ok(buf, size))
@@ -512,7 +512,7 @@  static long sbprof_tb_ioctl(struct file *filp,
 		if (err)
 			break;
 
-		err = put_user(TB_FULL, (int *) arg);
+		err = put_user(TB_FULL, (int __user *) arg);
 		break;
 	}