Message ID | 1438607342-11964-2-git-send-email-matanb@mellanox.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
On 08/03/2015 09:09 AM, Matan Barak wrote: > The error flow of _gid_table_setup_one accessed table[port] when > port was 1-based instead of 0-based. > > Squash-into: 'IB/core: Add RoCE GID table management' > Signed-off-by: Matan Barak <matanb@mellanox.com> Squashed as requested.
diff --git a/drivers/infiniband/core/cache.c b/drivers/infiniband/core/cache.c index a9d5c70..01b8792 100644 --- a/drivers/infiniband/core/cache.c +++ b/drivers/infiniband/core/cache.c @@ -582,8 +582,9 @@ static int _gid_table_setup_one(struct ib_device *ib_dev) return 0; rollback_table_setup: - for (port = 1; port <= ib_dev->phys_port_cnt; port++) - free_gid_table(ib_dev, port, table[port]); + for (port = 0; port < ib_dev->phys_port_cnt; port++) + free_gid_table(ib_dev, port + rdma_start_port(ib_dev), + table[port]); kfree(table); return err;
The error flow of _gid_table_setup_one accessed table[port] when port was 1-based instead of 0-based. Squash-into: 'IB/core: Add RoCE GID table management' Signed-off-by: Matan Barak <matanb@mellanox.com> --- drivers/infiniband/core/cache.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)