Skip to content

Commit

Permalink
dlm: config: Fix ENOMEM failures in make_cluster()
Browse files Browse the repository at this point in the history
Commit 1ae1602 "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: Bob Peterson <[email protected]>
Reviewed-by: Andreas Gruenbacher <[email protected]>
Signed-off-by: Andrew Price <[email protected]>
Signed-off-by: David Teigland <[email protected]>
  • Loading branch information
andyprice authored and teigland committed Mar 29, 2016
1 parent f55532a commit 82c7d82
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fs/dlm/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,13 +343,12 @@ static struct config_group *make_cluster(struct config_group *g,
struct dlm_cluster *cl = NULL;
struct dlm_spaces *sps = NULL;
struct dlm_comms *cms = NULL;
void *gps = NULL;

cl = kzalloc(sizeof(struct dlm_cluster), GFP_NOFS);
sps = kzalloc(sizeof(struct dlm_spaces), GFP_NOFS);
cms = kzalloc(sizeof(struct dlm_comms), GFP_NOFS);

if (!cl || !gps || !sps || !cms)
if (!cl || !sps || !cms)
goto fail;

config_group_init_type_name(&cl->group, name, &cluster_type);
Expand Down

0 comments on commit 82c7d82

Please sign in to comment.