aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
Diffstat (limited to 'net/core')
-rw-r--r--net/core/flow.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/net/core/flow.c b/net/core/flow.c
index d137f971f97d..5d25697920b1 100644
--- a/net/core/flow.c
+++ b/net/core/flow.c
@@ -231,22 +231,16 @@ nocache:
231 231
232 err = resolver(key, family, dir, &obj, &obj_ref); 232 err = resolver(key, family, dir, &obj, &obj_ref);
233 233
234 if (fle) { 234 if (fle && !err) {
235 if (err) { 235 fle->genid = atomic_read(&flow_cache_genid);
236 /* Force security policy check on next lookup */ 236
237 *head = fle->next; 237 if (fle->object)
238 flow_entry_kill(cpu, fle); 238 atomic_dec(fle->object_ref);
239 } else { 239
240 fle->genid = atomic_read(&flow_cache_genid); 240 fle->object = obj;
241 241 fle->object_ref = obj_ref;
242 if (fle->object) 242 if (obj)
243 atomic_dec(fle->object_ref); 243 atomic_inc(fle->object_ref);
244
245 fle->object = obj;
246 fle->object_ref = obj_ref;
247 if (obj)
248 atomic_inc(fle->object_ref);
249 }
250 } 244 }
251 local_bh_enable(); 245 local_bh_enable();
252 246