Commit 2f229bcf authored by Bart Van Assche's avatar Bart Van Assche Committed by Jason Gunthorpe

RDMA/rxe: Simplify the error handling code in rxe_create_ah()

This patch not only simplifies the error handling code in rxe_create_ah()
but also removes the dead code that was left behind by commit 47ec3866
("RDMA: Convert drivers to use sgid_attr instead of sgid_index").
Signed-off-by: default avatarBart Van Assche <bart.vanassche@wdc.com>
Reviewed-by: default avatarParav Pandit <parav@mellanox.com>
Reviewed-by: default avatarLeon Romanovsky <leonro@mellanox.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent efdbda81
...@@ -241,24 +241,17 @@ static struct ib_ah *rxe_create_ah(struct ib_pd *ibpd, ...@@ -241,24 +241,17 @@ static struct ib_ah *rxe_create_ah(struct ib_pd *ibpd,
err = rxe_av_chk_attr(rxe, attr); err = rxe_av_chk_attr(rxe, attr);
if (err) if (err)
goto err1; return ERR_PTR(err);
ah = rxe_alloc(&rxe->ah_pool); ah = rxe_alloc(&rxe->ah_pool);
if (!ah) { if (!ah)
err = -ENOMEM; return ERR_PTR(-ENOMEM);
goto err1;
}
rxe_add_ref(pd); rxe_add_ref(pd);
ah->pd = pd; ah->pd = pd;
rxe_init_av(rxe, attr, &ah->av); rxe_init_av(rxe, attr, &ah->av);
return &ah->ibah; return &ah->ibah;
rxe_drop_ref(pd);
rxe_drop_ref(ah);
err1:
return ERR_PTR(err);
} }
static int rxe_modify_ah(struct ib_ah *ibah, struct rdma_ah_attr *attr) static int rxe_modify_ah(struct ib_ah *ibah, struct rdma_ah_attr *attr)
......
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