Skip to content

Commit

Permalink
IB/user_mad: Fix buggy usage of port index
Browse files Browse the repository at this point in the history
The addition of the rdma_cap_ib_mad is technically broken in ib_umad_remove_one
because the loop "i" value is not a port value.

This bug resulted in the ib_umad failing to properly remove its resources when
the core capability functions were converted to bit fields.

NOTE: e17371d73908 did not result in broken behavior on its own.  It was only
an issue when the implementation of rdma_cap_ib_mad was changed.

Pass the port value to rdma_cap_ib_mad.

Fixes: e17371d73908 ("IB/Verbs: Use management helper rdma_cap_ib_mad()")

Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
  • Loading branch information
Ira Weiny authored and Doug Ledford committed May 20, 2015
1 parent ab8be61 commit 26c4542
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/infiniband/core/user_mad.c
Original file line number Diff line number Diff line change
Expand Up @@ -1325,7 +1325,7 @@ static void ib_umad_remove_one(struct ib_device *device)
return;

for (i = 0; i <= rdma_end_port(device) - rdma_start_port(device); ++i) {
if (rdma_cap_ib_mad(device, i))
if (rdma_cap_ib_mad(device, i + rdma_start_port(device)))
ib_umad_kill_port(&umad_dev->port[i]);
}

Expand Down

0 comments on commit 26c4542

Please sign in to comment.