Skip to content

Commit

Permalink
[IB] umad: two small fixes
Browse files Browse the repository at this point in the history
Two small fixes for the umad module:
 - set kobject name for issm device properly
 - in ib_umad_add_one(), s is subtracted from the index i when
   initializing ports, so s should be subtracted from the index when
   freeing ports in the error path as well.

Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
  • Loading branch information
Michael S. Tsirkin authored and Roland Dreier committed Nov 6, 2005
1 parent 0f69ce1 commit 8b37b94
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/infiniband/core/user_mad.c
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ static int ib_umad_init_port(struct ib_device *device, int port_num,
goto err_class;
port->sm_dev->owner = THIS_MODULE;
port->sm_dev->ops = &umad_sm_fops;
kobject_set_name(&port->dev->kobj, "issm%d", port->dev_num);
kobject_set_name(&port->sm_dev->kobj, "issm%d", port->dev_num);
if (cdev_add(port->sm_dev, base_dev + port->dev_num + IB_UMAD_MAX_PORTS, 1))
goto err_sm_cdev;

Expand Down Expand Up @@ -913,7 +913,7 @@ static void ib_umad_add_one(struct ib_device *device)

err:
while (--i >= s)
ib_umad_kill_port(&umad_dev->port[i]);
ib_umad_kill_port(&umad_dev->port[i - s]);

kref_put(&umad_dev->ref, ib_umad_release_dev);
}
Expand Down

0 comments on commit 8b37b94

Please sign in to comment.