]> git.baikalelectronics.ru Git - kernel.git/commit
drop_monitor: work around gcc-10 stringop-overflow warning
authorArnd Bergmann <arnd@arndb.de>
Thu, 30 Apr 2020 21:30:49 +0000 (23:30 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 1 May 2020 22:45:16 +0000 (15:45 -0700)
commit7fa91fc45b42da2dd79486da47112fcdb786e281
tree54aa52b437c67559860d908d63701bbacbb65278
parenta06c924b566a21949eeffe09b4afc2e83781ce48
drop_monitor: work around gcc-10 stringop-overflow warning

The current gcc-10 snapshot produces a false-positive warning:

net/core/drop_monitor.c: In function 'trace_drop_common.constprop':
cc1: error: writing 8 bytes into a region of size 0 [-Werror=stringop-overflow=]
In file included from net/core/drop_monitor.c:23:
include/uapi/linux/net_dropmon.h:36:8: note: at offset 0 to object 'entries' with size 4 declared here
   36 |  __u32 entries;
      |        ^~~~~~~

I reported this in the gcc bugzilla, but in case it does not get
fixed in the release, work around it by using a temporary variable.

Fixes: 6c556817ce7a ("Network Drop Monitor: Adding drop monitor implementation & Netlink protocol")
Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94881
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/drop_monitor.c