mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
IB/rxe: Fix ref leak in rxe_create_qp()
The udata->inlen error path needs to clean up the ref added by rxe_alloc(). Signed-off-by: Andrew Boyer <[email protected]> Signed-off-by: Doug Ledford <[email protected]>
This commit is contained in:
parent
accacb8f51
commit
5b9ea16c54
1 changed files with 4 additions and 3 deletions
|
|
@ -564,7 +564,7 @@ static struct ib_qp *rxe_create_qp(struct ib_pd *ibpd,
|
|||
if (udata) {
|
||||
if (udata->inlen) {
|
||||
err = -EINVAL;
|
||||
goto err1;
|
||||
goto err2;
|
||||
}
|
||||
qp->is_user = 1;
|
||||
}
|
||||
|
|
@ -573,12 +573,13 @@ static struct ib_qp *rxe_create_qp(struct ib_pd *ibpd,
|
|||
|
||||
err = rxe_qp_from_init(rxe, qp, pd, init, udata, ibpd);
|
||||
if (err)
|
||||
goto err2;
|
||||
goto err3;
|
||||
|
||||
return &qp->ibqp;
|
||||
|
||||
err2:
|
||||
err3:
|
||||
rxe_drop_index(qp);
|
||||
err2:
|
||||
rxe_drop_ref(qp);
|
||||
err1:
|
||||
return ERR_PTR(err);
|
||||
|
|
|
|||
Loading…
Reference in a new issue