File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -164,8 +164,8 @@ struct ucounts *get_ucounts(struct ucounts *ucounts)
164
164
struct ucounts * alloc_ucounts (struct user_namespace * ns , kuid_t uid )
165
165
{
166
166
struct hlist_head * hashent = ucounts_hashentry (ns , uid );
167
- struct ucounts * ucounts , * new ;
168
167
bool wrapped ;
168
+ struct ucounts * ucounts , * new = NULL ;
169
169
170
170
spin_lock_irq (& ucounts_lock );
171
171
ucounts = find_ucounts (ns , uid , hashent );
@@ -182,17 +182,17 @@ struct ucounts *alloc_ucounts(struct user_namespace *ns, kuid_t uid)
182
182
183
183
spin_lock_irq (& ucounts_lock );
184
184
ucounts = find_ucounts (ns , uid , hashent );
185
- if (ucounts ) {
186
- kfree (new );
187
- } else {
185
+ if (!ucounts ) {
188
186
hlist_add_head (& new -> node , hashent );
189
187
get_user_ns (new -> ns );
190
188
spin_unlock_irq (& ucounts_lock );
191
189
return new ;
192
190
}
193
191
}
192
+
194
193
wrapped = !get_ucounts_or_wrap (ucounts );
195
194
spin_unlock_irq (& ucounts_lock );
195
+ kfree (new );
196
196
if (wrapped ) {
197
197
put_ucounts (ucounts );
198
198
return NULL ;
You can’t perform that action at this time.
0 commit comments