diff options
author | Ram Amrani <Ram.Amrani@cavium.com> | 2017-02-20 22:43:30 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-02-20 17:11:54 -0500 |
commit | 670dde55c6f182b8a159f0484be92b89d82107e1 (patch) | |
tree | f8aca3b123d968cb0afd73df8f41fcceb7fd6b17 /drivers/net/ethernet | |
parent | 8676ea8f3f9b7dc93544477821f107004c0366cf (diff) | |
download | linux-670dde55c6f182b8a159f0484be92b89d82107e1.tar.bz2 |
qed: Release CQ resource under lock on failure
The CQ resource pool is protected by a spin lock. When a CQ creation
fails it now deallocates under that lock as well.
Signed-off-by: Ram Amrani <Ram.Amrani@cavium.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/qlogic/qed/qed_roce.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/qlogic/qed/qed_roce.c b/drivers/net/ethernet/qlogic/qed/qed_roce.c index c3c8c5018e93..50fdcd3fa9b4 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_roce.c +++ b/drivers/net/ethernet/qlogic/qed/qed_roce.c @@ -948,7 +948,9 @@ static int qed_rdma_create_cq(void *rdma_cxt, err: /* release allocated icid */ + spin_lock_bh(&p_info->lock); qed_bmap_release_id(p_hwfn, &p_info->cq_map, returned_id); + spin_unlock_bh(&p_info->lock); DP_NOTICE(p_hwfn, "Create CQ failed, rc = %d\n", rc); return rc; |