Skip to content

Commit

Permalink
msm: ipa3: Fix incorrect copy size in debugfs drop stats node
Browse files Browse the repository at this point in the history
GCC complains about this:

In file included from ../arch/arm64/include/asm/preempt.h:5,
                 from ../include/linux/preempt.h:78,
                 from ../include/linux/spinlock.h:51,
                 from ../include/linux/wait.h:9,
                 from ../include/linux/wait_bit.h:8,
                 from ../include/linux/fs.h:6,
                 from ../include/linux/debugfs.h:18,
                 from ../drivers/platform/msm/ipa/ipa_v3/ipa_hw_stats.c:13:
In function 'check_copy_size',
    inlined from 'ipa_debugfs_enable_disable_drop_stats' at ../include/linux/uaccess.h:146:6:
../include/linux/thread_info.h:136:4: error: call to '__bad_copy_to' declared with attribute error: copy destination size is too small
  136 |    __bad_copy_to();
      |    ^~~~~~~~~~~~~~~

Signed-off-by: Danny Lin <danny@kdrag0n.dev>
  • Loading branch information
kdrag0n committed Oct 28, 2020
1 parent d8c51e7 commit c49034c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/platform/msm/ipa/ipa_v3/ipa_hw_stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -1895,7 +1895,7 @@ static ssize_t ipa_debugfs_enable_disable_drop_stats(struct file *file,
ssize_t ret;

mutex_lock(&ipa3_ctx->lock);
if (sizeof(dbg_buff) < count + 1) {
if (sizeof(dbg_buff) < count) {
ret = -EFAULT;
goto bail;
}
Expand Down

0 comments on commit c49034c

Please sign in to comment.