Commit 8a765471 authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller

octeontx2-pf: unlock on error path in otx2_config_pause_frm()

We need to unlock before returning if this allocation fails.

Fixes: 75f36270 ("octeontx2-pf: Support to enable/disable pause frames via ethtool")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0f70eedc
...@@ -227,14 +227,17 @@ int otx2_config_pause_frm(struct otx2_nic *pfvf) ...@@ -227,14 +227,17 @@ int otx2_config_pause_frm(struct otx2_nic *pfvf)
otx2_mbox_lock(&pfvf->mbox); otx2_mbox_lock(&pfvf->mbox);
req = otx2_mbox_alloc_msg_cgx_cfg_pause_frm(&pfvf->mbox); req = otx2_mbox_alloc_msg_cgx_cfg_pause_frm(&pfvf->mbox);
if (!req) if (!req) {
return -ENOMEM; err = -ENOMEM;
goto unlock;
}
req->rx_pause = !!(pfvf->flags & OTX2_FLAG_RX_PAUSE_ENABLED); req->rx_pause = !!(pfvf->flags & OTX2_FLAG_RX_PAUSE_ENABLED);
req->tx_pause = !!(pfvf->flags & OTX2_FLAG_TX_PAUSE_ENABLED); req->tx_pause = !!(pfvf->flags & OTX2_FLAG_TX_PAUSE_ENABLED);
req->set = 1; req->set = 1;
err = otx2_sync_mbox_msg(&pfvf->mbox); err = otx2_sync_mbox_msg(&pfvf->mbox);
unlock:
otx2_mbox_unlock(&pfvf->mbox); otx2_mbox_unlock(&pfvf->mbox);
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment