File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -76,19 +76,21 @@ void free_shrinker_info(struct mem_cgroup *memcg)
76
76
77
77
int alloc_shrinker_info (struct mem_cgroup * memcg )
78
78
{
79
- struct shrinker_info * info ;
80
79
int nid , ret = 0 ;
81
80
int array_size = 0 ;
82
81
83
82
mutex_lock (& shrinker_mutex );
84
83
array_size = shrinker_unit_size (shrinker_nr_max );
85
84
for_each_node (nid ) {
86
- info = kvzalloc_node (sizeof (* info ) + array_size , GFP_KERNEL , nid );
85
+ struct shrinker_info * info = kvzalloc_node (sizeof (* info ) + array_size ,
86
+ GFP_KERNEL , nid );
87
87
if (!info )
88
88
goto err ;
89
89
info -> map_nr_max = shrinker_nr_max ;
90
- if (shrinker_unit_alloc (info , NULL , nid ))
90
+ if (shrinker_unit_alloc (info , NULL , nid )) {
91
+ kvfree (info );
91
92
goto err ;
93
+ }
92
94
rcu_assign_pointer (memcg -> nodeinfo [nid ]-> shrinker_info , info );
93
95
}
94
96
mutex_unlock (& shrinker_mutex );
You can’t perform that action at this time.
0 commit comments