add patch mballoc-avoid-20-argument-function-call
[ext4-patch-queue.git] / crypto-fix-sparse-warnings
blobd71940342c34a1f9878d4e4627d1c55556609d1f
1 ext4 crypto: fix sparse warnings in fs/ext4/ioctl.c
3 From: Fabian Frederick <fabf@skynet.be>
5 [ Added another sparse fix for EXT4_IOC_GET_ENCRYPTION_POLICY while
6   we're at it. --tytso ]
8 Signed-off-by: Fabian Frederick <fabf@skynet.be>
9 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 ---
11  fs/ext4/ioctl.c | 6 +++---
12  1 file changed, 3 insertions(+), 3 deletions(-)
14 diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
15 index 2cb9e17..7ce8582 100644
16 --- a/fs/ext4/ioctl.c
17 +++ b/fs/ext4/ioctl.c
18 @@ -675,8 +675,8 @@ encryption_policy_out:
19                         if (err)
20                                 return err;
21                 }
22 -               if (copy_to_user((void *) arg, sbi->s_es->s_encrypt_pw_salt,
23 -                                16))
24 +               if (copy_to_user((void __user *) arg,
25 +                                sbi->s_es->s_encrypt_pw_salt, 16))
26                         return -EFAULT;
27                 return 0;
28         }
29 @@ -690,7 +690,7 @@ encryption_policy_out:
30                 err = ext4_get_policy(inode, &policy);
31                 if (err)
32                         return err;
33 -               if (copy_to_user((void *)arg, &policy, sizeof(policy)))
34 +               if (copy_to_user((void __user *)arg, &policy, sizeof(policy)))
35                         return -EFAULT;
36                 return 0;
37  #else