fix bug in debug output
running "head" on /dev/sfe would crash.
Change-Id: I37b48050ad47bff09753fabfdc4efbab01e5fab6
Signed-off-by: Nicolas Costa <ncosta@codeaurora.org>
diff --git a/shortcut-fe/sfe_ipv4.c b/shortcut-fe/sfe_ipv4.c
index d7716f2..b1b32de 100644
--- a/shortcut-fe/sfe_ipv4.c
+++ b/shortcut-fe/sfe_ipv4.c
@@ -3222,11 +3222,13 @@
c = ws->iter_conn;
if (c) {
struct sfe_ipv4 *si = &__si;
+ bool free_connection;
spin_lock_bh(&si->lock);
- if (sfe_ipv4_decrement_sfe_ipv4_connection_iterator(si, c)) {
- spin_unlock_bh(&si->lock);
+ free_connection = sfe_ipv4_decrement_sfe_ipv4_connection_iterator(si, c);
+ spin_unlock_bh(&si->lock);
+ if (free_connection) {
/*
* This entry is dead so release our hold of the source and
* dest devices and free the memory for our connection objects.