]> git.baikalelectronics.ru Git - kernel.git/commit
mvpp2: use correct size for memset
authorArnd Bergmann <arnd@arndb.de>
Thu, 24 Nov 2016 16:28:12 +0000 (17:28 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sat, 26 Nov 2016 01:57:21 +0000 (20:57 -0500)
commitf8fefcc4f43b55e812c983e4a049d00b6865f41d
treee6d9c605095627b7739cee205230ede958e8e7ef
parent7c5ac300982b48e97214f7e6f323791f6f202c10
mvpp2: use correct size for memset

gcc-7 detects a short memset in mvpp2, introduced in the original
merge of the driver:

drivers/net/ethernet/marvell/mvpp2.c: In function 'mvpp2_cls_init':
drivers/net/ethernet/marvell/mvpp2.c:3296:2: error: 'memset' used with length equal to number of elements without multiplication by element size [-Werror=memset-elt-size]

The result seems to be that we write uninitialized data into the
flow table registers, although we did not get any warning about
that uninitialized data usage.

Using sizeof() lets us initialize then entire array instead.

Fixes: decc8a74c68c ("ethernet: Add new driver for Marvell Armada 375 network unit")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/mvpp2.c