ethdev: avoid getting uninitialized info for bad port
authorAndrew Rybchenko <arybchenko@solarflare.com>
Tue, 23 Jul 2019 12:11:21 +0000 (13:11 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 23 Jul 2019 18:28:17 +0000 (20:28 +0200)
commitb6719879855da581c4b6dc29680b54c10e109439
treee293a6f027bddb162810dcfcc5911c8846805a46
parentea81c1b816f7ef7e072ee4d3155d4dcdd2aba32a
ethdev: avoid getting uninitialized info for bad port

rte_eth_dev_info_get() returns void and caller does know if the function
does its job or not. Changing of the return value to int would be
API/ABI breakage which requires deprecation process and cannot be
backported to stable branches. For now, make sure that device info is
initialized even in the case of invalid port ID.

Fixes: a30268e9a2d0 ("ethdev: reset whole dev info structure before filling")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
lib/librte_ethdev/rte_ethdev.c