Jason Gunthorpe 0099103926 RDMA/uverbs: Fix error unwind in ib_uverbs_add_one
The error path has several mistakes

- cdev_del should not be called if cdev_device_add fails
- We must call put_device on all the goto exit paths as that is what frees
  the uapi, SRCU and the struct itself.

While we are here consolidate all the uvdev_dev init that cannot fail at
the top.

Fixes: c5c4d92e70f3 ("RDMA/uverbs: Use cdev_device_add() instead of cdev_add()")
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Reviewed-by: Parav Pandit <parav@mellanox.com>
2018-09-19 10:49:22 -06:00
..
2015-06-12 14:49:18 -04:00
2018-06-12 16:19:22 -07:00
2018-06-18 11:22:54 -06:00
2018-09-06 13:35:16 -06:00
2016-05-13 13:37:18 -04:00
2016-03-03 10:20:25 -05:00
2018-08-13 20:04:37 -06:00
2016-03-03 10:20:25 -05:00