Skip to contentSkip to conversation

ceph: create_workqueue() doesn't return ERR_PTR

PATCH New Dan Carpenter 1 participant 1 message Jul 31, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ceph: create_workqueue() doesn't return ERR_PTR

create_workqueue() returns a NULL pointer on errors.

fs/ceph/messenger.c +3 -5
index 15167b2..d959dba 100644
@@ -94,11 +94,9 @@ struct workqueue_struct *ceph_msgr_wq;
 int __init 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;
 }