Skip to content

Commit af6858e

Browse files
mkalderondavem330
authored andcommitted
qed: Fix l2 initializations over iWARP personality
If qede driver was loaded on a device configured for iWARP the l2 mutex wouldn't be allocated, and some l2 related resources wouldn't be freed. fixes: c851a9d ("qed: Introduce iWARP personality") Signed-off-by: Michal Kalderon <[email protected]> Signed-off-by: Sudarsana Kalluru <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 94f6a80 commit af6858e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/net/ethernet/qlogic/qed/qed_l2.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,7 @@ int qed_l2_alloc(struct qed_hwfn *p_hwfn)
115115

116116
void qed_l2_setup(struct qed_hwfn *p_hwfn)
117117
{
118-
if (p_hwfn->hw_info.personality != QED_PCI_ETH &&
119-
p_hwfn->hw_info.personality != QED_PCI_ETH_ROCE)
118+
if (!QED_IS_L2_PERSONALITY(p_hwfn))
120119
return;
121120

122121
mutex_init(&p_hwfn->p_l2_info->lock);
@@ -126,8 +125,7 @@ void qed_l2_free(struct qed_hwfn *p_hwfn)
126125
{
127126
u32 i;
128127

129-
if (p_hwfn->hw_info.personality != QED_PCI_ETH &&
130-
p_hwfn->hw_info.personality != QED_PCI_ETH_ROCE)
128+
if (!QED_IS_L2_PERSONALITY(p_hwfn))
131129
return;
132130

133131
if (!p_hwfn->p_l2_info)

0 commit comments

Comments
 (0)