Skip to content

Commit

Permalink
ceph: fix msgr_init error path
Browse files Browse the repository at this point in the history
create_workqueue() returns NULL on failure.

Signed-off-by: Sage Weil <sage@newdream.net>
  • Loading branch information
Sage Weil committed Dec 14, 2010
1 parent 1cd275f commit d96c904
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions net/ceph/messenger.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit d96c904

Please sign in to comment.