net/nfp: fix memcpy out of source range
authorAndy Green <andy@warmcat.com>
Mon, 14 May 2018 05:00:32 +0000 (13:00 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 14 May 2018 21:32:23 +0000 (23:32 +0200)
commit1bcb5ecb179cbca81ff3fe15432326c1c3ca9e9b
treee94ddfa7fafd3ce41bb5360b5ad23db18ad16a8d
parent62280b7819d24643e70a1428191288133d3d7235
net/nfp: fix memcpy out of source range

drivers/net/nfp/nfp_net.c:669:2: error:
‘memcpy’ forming offset [5, 6] is out of the bounds [0, 4]
of object ‘tmp’ with type ‘uint32_t’ {aka ‘unsigned int’}
[-Werror=array-bounds]
memcpy(&hw->mac_addr[0], &tmp, sizeof(struct ether_addr));

Fixes: e6decee38209 ("net/nfp: use random MAC address if not configured")
Cc: stable@dpdk.org
Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Alejandro Lucero <alejandro.lucero@netronome.com>
Tested-by: Alejandro Lucero <alejandro.lucero@netronome.com>
drivers/net/nfp/nfp_net.c