net: stmmac: selftests: Use struct_size() helper in kzalloc()
authorGustavo A. R. Silva <gustavoars@kernel.org>
Tue, 16 Jun 2020 23:03:28 +0000 (18:03 -0500)
committerDavid S. Miller <davem@davemloft.net>
Fri, 19 Jun 2020 03:19:20 +0000 (20:19 -0700)
commit4e638025f25652b052ec54cf75e4cfe4f4663ce7
tree9c3adb9752b29a79750c56843de08f07174246fd
parent3dd1499666f64817173c6390ed4d387471d07df8
net: stmmac: selftests: Use struct_size() helper in kzalloc()

Make use of the struct_size() helper instead of an open-coded version
in order to avoid any potential type mistakes.

This code was detected with the help of Coccinelle and, audited and
fixed manually.

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c