Message ID | 1480094076-20199-2-git-send-email-christophe.milard@linaro.org |
---|---|
State | Accepted |
Commit | dd4fce83fe3168e7cc1ca9ae8ecbea0da2665de2 |
Headers | show |
diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index 0b9939b..3524ff8 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -1054,7 +1054,7 @@ void odp_pktio_print(odp_pktio_t hdl) int odp_pktio_term_global(void) { - int ret; + int ret = 0; int i; int pktio_if; @@ -1073,7 +1073,9 @@ int odp_pktio_term_global(void) ODP_ABORT("unable to stop pktio %s\n", pktio_entry->s.name); } - ret = _pktio_close(pktio_entry); + + if (pktio_entry->s.state != PKTIO_STATE_CLOSE_PENDING) + ret = _pktio_close(pktio_entry); if (ret) ODP_ABORT("unable to close pktio %s\n", pktio_entry->s.name);
If odp_pktio_term_global() is called while a pktio in in state PKTIO_STATE_CLOSE_PENDING, a new close() is attempted on a already closed pktio, resulting as an abort. This patch fixes this. Signed-off-by: Christophe Milard <christophe.milard@linaro.org> --- platform/linux-generic/odp_packet_io.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.7.4