ceph: fix msgr_init error path
authorSage Weil <sage@newdream.net>
Tue, 14 Dec 2010 04:30:28 +0000 (20:30 -0800)
committerSage Weil <sage@newdream.net>
Tue, 14 Dec 2010 04:30:28 +0000 (20:30 -0800)
create_workqueue() returns NULL on failure.

Signed-off-by: Sage Weil <sage@newdream.net>
net/ceph/messenger.c

index 1c7a2ec..b6ff4a1 100644 (file)
@@ -97,11 +97,9 @@ struct workqueue_struct *ceph_msgr_wq;
 int ceph_msgr_init(void)
 {
        ceph_msgr_wq = create_workqueue("ceph-msgr");
-       if (IS_ERR(ceph_msgr_wq)) {
-               int ret = PTR_ERR(ceph_msgr_wq);
-               pr_err("msgr_init failed to create workqueue: %d\n", ret);
-               ceph_msgr_wq = NULL;
-               return ret;
+       if (!ceph_msgr_wq) {
+               pr_err("msgr_init failed to create workqueue\n");
+               return -ENOMEM;
        }
        return 0;
 }