ANDROID: Incremental fs: Fix mislabeled __user ptrs

Found by sparse

Bug: 153174547
Test: make C=2 fs/incfs/incrementalfs.ko no errors, incfs_test pass
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: I9ff4f4f35975fe09936724488b96cd8bdeeb719e
Git-commit: 23f5b7c508
Git-repo: https://android.googlesource.com/kernel/common/
Signed-off-by: Sayali Lokhande <sayalil@codeaurora.org>
This commit is contained in:
Paul Lawrence
2020-04-03 11:17:53 -07:00
committed by Blagovest Kolenichev
parent c10f00ee9e
commit 5663542e52
3 changed files with 6 additions and 5 deletions

View File

@@ -396,7 +396,8 @@ static int copy_one_range(struct incfs_filled_range *range, void __user *buffer,
if (error)
return error;
if (copy_to_user(((char *)buffer) + *size_out, range, sizeof(*range)))
if (copy_to_user(((char __user *)buffer) + *size_out, range,
sizeof(*range)))
return -EFAULT;
*size_out += sizeof(*range);
@@ -437,7 +438,7 @@ int incfs_get_filled_blocks(struct data_file *df,
int error = 0;
bool in_range = false;
struct incfs_filled_range range;
void *buffer = u64_to_user_ptr(arg->range_buffer);
void __user *buffer = u64_to_user_ptr(arg->range_buffer);
u32 size = arg->range_buffer_size;
u32 end_index =
arg->end_index ? arg->end_index : df->df_total_block_count;