libceph: fix error handling in ceph_osdc_init()
authorIlya Dryomov <ilya.dryomov@inktank.com>
Fri, 31 Jan 2014 15:49:22 +0000 (17:49 +0200)
committerIlya Dryomov <ilya.dryomov@inktank.com>
Mon, 3 Feb 2014 17:20:59 +0000 (19:20 +0200)
msgpool_op_reply message pool isn't destroyed if workqueue construction
fails.  Fix it.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
net/ceph/osd_client.c

index 010ff3b..166d4c7 100644 (file)
@@ -2504,9 +2504,12 @@ int ceph_osdc_init(struct ceph_osd_client *osdc, struct ceph_client *client)
        err = -ENOMEM;
        osdc->notify_wq = create_singlethread_workqueue("ceph-watch-notify");
        if (!osdc->notify_wq)
-               goto out_msgpool;
+               goto out_msgpool_reply;
+
        return 0;
 
+out_msgpool_reply:
+       ceph_msgpool_destroy(&osdc->msgpool_op_reply);
 out_msgpool:
        ceph_msgpool_destroy(&osdc->msgpool_op);
 out_mempool: