diff --git a/lib/dpctl.c b/lib/dpctl.c index 151848b90..cdff4206e 100644 --- a/lib/dpctl.c +++ b/lib/dpctl.c @@ -738,8 +738,8 @@ show_dpif(struct dpif *dpif, struct dpctl_params *dpctl_p) continue; } error = netdev_get_stats(netdev, &s); + netdev_close(netdev); if (!error) { - netdev_close(netdev); print_stat(dpctl_p, " RX packets:", s.rx_packets); print_stat(dpctl_p, " errors:", s.rx_errors); print_stat(dpctl_p, " dropped:", s.rx_dropped);