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>
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;
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: