All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-next:master 5025/9010] tcp_mmap.c:211:61: warning: 'lu' may be used uninitialized in this function
@ 2023-04-04 14:05 kernel test robot
  2023-04-04 16:17 ` Eric Dumazet
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2023-04-04 14:05 UTC (permalink / raw)
  To: Xiaoyan Li
  Cc: oe-kbuild-all, Linux Memory Management List, Paolo Abeni, Eric Dumazet

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   6a53bda3aaf3de5edeea27d0b1d8781d067640b6
commit: 5c5945dc695c54f2b55a934a10b6c4e220f9c140 [5025/9010] selftests/net: Add SHA256 computation over data sent in tcp_mmap
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
reproduce:
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=5c5945dc695c54f2b55a934a10b6c4e220f9c140
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout 5c5945dc695c54f2b55a934a10b6c4e220f9c140
        make O=/tmp/kselftest headers
        make O=/tmp/kselftest -C tools/testing/selftests

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202304042104.UFIuevBp-lkp@intel.com/

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All warnings (new ones prefixed by >>):

   tcp_mmap.c: In function 'child_thread':
>> tcp_mmap.c:211:61: warning: 'lu' may be used uninitialized in this function [-Wmaybe-uninitialized]
     211 |                         zc.length = min(chunk_size, FILE_SZ - lu);
         |                                                             ^

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [linux-next:master 5025/9010] tcp_mmap.c:211:61: warning: 'lu' may be used uninitialized in this function
  2023-04-04 14:05 [linux-next:master 5025/9010] tcp_mmap.c:211:61: warning: 'lu' may be used uninitialized in this function kernel test robot
@ 2023-04-04 16:17 ` Eric Dumazet
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Dumazet @ 2023-04-04 16:17 UTC (permalink / raw)
  To: kernel test robot
  Cc: Xiaoyan Li, oe-kbuild-all, Linux Memory Management List, Paolo Abeni

On Tue, Apr 4, 2023 at 4:10 PM kernel test robot <lkp@intel.com> wrote:
>
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head:   6a53bda3aaf3de5edeea27d0b1d8781d067640b6
> commit: 5c5945dc695c54f2b55a934a10b6c4e220f9c140 [5025/9010] selftests/net: Add SHA256 computation over data sent in tcp_mmap
> compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
> reproduce:
>         # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=5c5945dc695c54f2b55a934a10b6c4e220f9c140
>         git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
>         git fetch --no-tags linux-next master
>         git checkout 5c5945dc695c54f2b55a934a10b6c4e220f9c140
>         make O=/tmp/kselftest headers
>         make O=/tmp/kselftest -C tools/testing/selftests
>
> If you fix the issue, kindly add following tag where applicable
> | Reported-by: kernel test robot <lkp@intel.com>
> | Link: https://lore.kernel.org/oe-kbuild-all/202304042104.UFIuevBp-lkp@intel.com/
>
> Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
> http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings
>
> All warnings (new ones prefixed by >>):
>
>    tcp_mmap.c: In function 'child_thread':
> >> tcp_mmap.c:211:61: warning: 'lu' may be used uninitialized in this function [-Wmaybe-uninitialized]
>      211 |                         zc.length = min(chunk_size, FILE_SZ - lu);
>          |                                                             ^


This is not a false warning, I will submit this fix, thanks.

diff --git a/tools/testing/selftests/net/tcp_mmap.c
b/tools/testing/selftests/net/tcp_mmap.c
index 607cc9ad8d1b72cdcb96ca0d6fdb70900c9b9bc0..6e59b1461dcceaa658185071a758e1006b48299a
100644
--- a/tools/testing/selftests/net/tcp_mmap.c
+++ b/tools/testing/selftests/net/tcp_mmap.c
@@ -208,7 +208,7 @@ void *child_thread(void *arg)

                        memset(&zc, 0, sizeof(zc));
                        zc.address = (__u64)((unsigned long)addr);
-                       zc.length = min(chunk_size, FILE_SZ - lu);
+                       zc.length = min(chunk_size, FILE_SZ - total);

                        res = getsockopt(fd, IPPROTO_TCP, TCP_ZEROCOPY_RECEIVE,
                                         &zc, &zc_len);

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-04-04 16:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-04 14:05 [linux-next:master 5025/9010] tcp_mmap.c:211:61: warning: 'lu' may be used uninitialized in this function kernel test robot
2023-04-04 16:17 ` Eric Dumazet

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.