[patch] ib/rxe: double free on error

Dan Carpenter
2016-06-18T08:40:21Z

"goto err1" could probably be remained "goto free_pkey_tbl" since
that's what it does. This is a double free.

Fixes: 0784481b2f32 ('Add initialization for Soft RoCE driver, pools constants etc.')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/infiniband/hw/rxe/rxe.c b/drivers/infiniband/hw/rxe/rxe.c
index 48c41e00..50e25b0 100644
--- a/drivers/infiniband/hw/rxe/rxe.c
+++ b/drivers/infiniband/hw/rxe/rxe.c
@@ -187,7 +187,6 @@ static int rxe_init_ports(struct rxe_dev *rxe)
port->pkey_tbl[0] = 0xffff;

if (!port->attr.gid_tbl_len) {
- kfree(port->pkey_tbl);
err = -EINVAL;
goto err1;
}