diff options
author | Alex Elder <elder@inktank.com> | 2013-04-26 15:44:36 -0500 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-05-01 21:19:55 -0700 |
commit | 2e93bf9e465b7d0ccf703fb791c663435d9522cf (patch) | |
tree | ae1bbb292a93d0d51cdb6b42f2c46bd1f488eba8 /drivers/block | |
parent | ad945fc1da42965a31089d29de3754047861f348 (diff) |
rbd: remove parent devices on probe error
When an error occurs while finishing probing a device it is assumed
that parent devices get cleaned up when deleting a device. They
don't. Add a call to clean them up. Note that this means the
parent spec will already be cleaned up so it doesn't have to be
in one of the rbd_add() error paths.
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/rbd.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index bc1e6e8e2ad9..eed7029b8ee8 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -4813,8 +4813,7 @@ static int rbd_dev_probe_finish(struct rbd_device *rbd_dev) return ret; err_out_bus: - /* this will also clean up rest of rbd_dev stuff */ - + rbd_dev_remove_parent(rbd_dev); rbd_bus_del_dev(rbd_dev); return ret; @@ -4931,7 +4930,6 @@ static ssize_t rbd_add(struct bus_type *bus, return count; err_out_rbd_dev: - rbd_spec_put(rbd_dev->parent_spec); kfree(rbd_dev->header_name); rbd_dev_destroy(rbd_dev); err_out_client: |