Commit 82c7d823 authored by Andrew Price's avatar Andrew Price Committed by David Teigland

dlm: config: Fix ENOMEM failures in make_cluster()

Commit 1ae1602d "configfs: switch ->default groups to a linked list"
left the NULL gps pointer behind after removing the kcalloc() call which
made it non-NULL. It also left the !gps check in place so make_cluster()
now fails with ENOMEM. Remove the remaining uses of the gps variable to
fix that.
Reviewed-by: default avatarBob Peterson <rpeterso@redhat.com>
Reviewed-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: default avatarAndrew Price <anprice@redhat.com>
Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
parent f55532a0
...@@ -343,13 +343,12 @@ static struct config_group *make_cluster(struct config_group *g, ...@@ -343,13 +343,12 @@ static struct config_group *make_cluster(struct config_group *g,
struct dlm_cluster *cl = NULL; struct dlm_cluster *cl = NULL;
struct dlm_spaces *sps = NULL; struct dlm_spaces *sps = NULL;
struct dlm_comms *cms = NULL; struct dlm_comms *cms = NULL;
void *gps = NULL;
cl = kzalloc(sizeof(struct dlm_cluster), GFP_NOFS); cl = kzalloc(sizeof(struct dlm_cluster), GFP_NOFS);
sps = kzalloc(sizeof(struct dlm_spaces), GFP_NOFS); sps = kzalloc(sizeof(struct dlm_spaces), GFP_NOFS);
cms = kzalloc(sizeof(struct dlm_comms), GFP_NOFS); cms = kzalloc(sizeof(struct dlm_comms), GFP_NOFS);
if (!cl || !gps || !sps || !cms) if (!cl || !sps || !cms)
goto fail; goto fail;
config_group_init_type_name(&cl->group, name, &cluster_type); config_group_init_type_name(&cl->group, name, &cluster_type);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment