hash: fix missing spinlock unlock in add key

Fix missing spinlock unlock during add key when key is already present.

Fixes: be856325cba3 ("hash: add scalable multi-writer insertion with Intel TSX")
Cc: stable@dpdk.org

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
This commit is contained in:
Pavan Nikhilesh 2018-03-04 20:28:31 +05:30 committed by Thomas Monjalon
parent d389f9a352
commit e166e55c1a

View File

@ -552,7 +552,8 @@ __rte_hash_add_key_with_hash(const struct rte_hash *h, const void *key,
* Return index where key is stored,
* subtracting the first dummy index
*/
return prim_bkt->key_idx[i] - 1;
ret = prim_bkt->key_idx[i] - 1;
goto failure;
}
}
}
@ -572,7 +573,8 @@ __rte_hash_add_key_with_hash(const struct rte_hash *h, const void *key,
* Return index where key is stored,
* subtracting the first dummy index
*/
return sec_bkt->key_idx[i] - 1;
ret = sec_bkt->key_idx[i] - 1;
goto failure;
}
}
}