mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
crypto: octeontx2 - fix missing unlock
Add the missing unlock before return from error path.
Fixes: 4363f3d3ce
("crypto: octeontx2 - add synchronization between mailbox accesses")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
e6205ad58a
commit
280ee3c3aa
2 changed files with 6 additions and 2 deletions
|
@ -143,8 +143,10 @@ static void cptpf_flr_wq_handler(struct work_struct *work)
|
||||||
mutex_lock(&pf->lock);
|
mutex_lock(&pf->lock);
|
||||||
req = otx2_mbox_alloc_msg_rsp(mbox, 0, sizeof(*req),
|
req = otx2_mbox_alloc_msg_rsp(mbox, 0, sizeof(*req),
|
||||||
sizeof(struct msg_rsp));
|
sizeof(struct msg_rsp));
|
||||||
if (!req)
|
if (!req) {
|
||||||
|
mutex_unlock(&pf->lock);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
req->sig = OTX2_MBOX_REQ_SIG;
|
req->sig = OTX2_MBOX_REQ_SIG;
|
||||||
req->id = MBOX_MSG_VF_FLR;
|
req->id = MBOX_MSG_VF_FLR;
|
||||||
|
|
|
@ -20,8 +20,10 @@ static int forward_to_af(struct otx2_cptpf_dev *cptpf,
|
||||||
|
|
||||||
mutex_lock(&cptpf->lock);
|
mutex_lock(&cptpf->lock);
|
||||||
msg = otx2_mbox_alloc_msg(&cptpf->afpf_mbox, 0, size);
|
msg = otx2_mbox_alloc_msg(&cptpf->afpf_mbox, 0, size);
|
||||||
if (msg == NULL)
|
if (msg == NULL) {
|
||||||
|
mutex_unlock(&cptpf->lock);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
}
|
||||||
|
|
||||||
memcpy((uint8_t *)msg + sizeof(struct mbox_msghdr),
|
memcpy((uint8_t *)msg + sizeof(struct mbox_msghdr),
|
||||||
(uint8_t *)req + sizeof(struct mbox_msghdr), size);
|
(uint8_t *)req + sizeof(struct mbox_msghdr), size);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue