From: Ilya Dryomov <ilya.dryomov@inktank.com>
Date: Fri, 31 Jan 2014 17:49:22 +0200
Subject: libceph: fix error handling in ceph_osdc_init()
Git-commit: c172ec5c8dc8c09dd5958f4ae542fa321bb15a92
Patch-mainline: v3.14-rc2
References: FATE#318328 bsc#917884

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>
Acked-by: Lee Duncan <lduncan@suse.com>
---
 net/ceph/osd_client.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -2494,9 +2494,12 @@ int ceph_osdc_init(struct ceph_osd_clien
 	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:
