OSDN Git Service

RDMA/bnxt_re: Avoid resource leak in case the NQ registration fails
authorSelvin Xavier <selvin.xavier@broadcom.com>
Mon, 8 Oct 2018 10:28:04 +0000 (03:28 -0700)
committerJason Gunthorpe <jgg@mellanox.com>
Tue, 16 Oct 2018 06:03:51 +0000 (00:03 -0600)
commit5df950994934814a8b91f0cf9f653842d2ba082d
tree9a9681458210283fb1f5c9a42ec339f76a3e77d5
parenta08b9e9a705675ba05fa44f0342e2875fd1bda28
RDMA/bnxt_re: Avoid resource leak in case the NQ registration fails

In case the NQ alloc/enable fails, free up the already allocated/enabled
NQ before reporting failure. Also, track the alloc/enable using proper
state checking.

Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/bnxt_re/bnxt_re.h
drivers/infiniband/hw/bnxt_re/main.c