Skip to content

Commit 897fab7

Browse files
Yang Yingliangdavem330
authored andcommitted
octeontx2-pf: mcs: fix missing unlock in some error paths
Add the missing unlock in some error paths. Fixes: c54ffc7 ("octeontx2-pf: mcs: Introduce MACSEC hardware offloading") Signed-off-by: Yang Yingliang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent b64085b commit 897fab7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ static int cn10k_mcs_write_sc_cam(struct otx2_nic *pfvf,
284284

285285
sc_req = otx2_mbox_alloc_msg_mcs_rx_sc_cam_write(mbox);
286286
if (!sc_req) {
287-
return -ENOMEM;
287+
ret = -ENOMEM;
288288
goto fail;
289289
}
290290

@@ -594,7 +594,7 @@ static int cn10k_mcs_ena_dis_flowid(struct otx2_nic *pfvf, u16 hw_flow_id,
594594

595595
req = otx2_mbox_alloc_msg_mcs_flowid_ena_entry(mbox);
596596
if (!req) {
597-
return -ENOMEM;
597+
ret = -ENOMEM;
598598
goto fail;
599599
}
600600

@@ -1653,6 +1653,7 @@ int cn10k_mcs_init(struct otx2_nic *pfvf)
16531653
return 0;
16541654
fail:
16551655
dev_err(pfvf->dev, "Cannot notify PN wrapped event\n");
1656+
mutex_unlock(&mbox->lock);
16561657
return 0;
16571658
}
16581659

0 commit comments

Comments
 (0)