Commit 670dde55 authored by Ram Amrani's avatar Ram Amrani Committed by David S. Miller
Browse files

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: default avatarRam Amrani <Ram.Amrani@cavium.com>
Signed-off-by: default avatarYuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8676ea8f
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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;