Only cpu seeing dst refcount going to 0 can safely dereference dst->flags. Otherwise an other cpu might already have freed the dst.
Unified · Split
| @@ -306,7 +306,7 @@ void dst_release(struct dst_entry *dst) · 305 unmodified lines | ||
| 306 | 306 | if (unlikely(newrefcnt < 0)) |
| 307 | 307 | net_warn_ratelimited("%s: dst:%p refcnt:%d\n", |
| 308 | 308 | __func__, dst, newrefcnt); |
| 309 | − if (unlikely(dst->flags & DST_NOCACHE) && !newrefcnt) | |
| 309 | + if (!newrefcnt && unlikely(dst->flags & DST_NOCACHE)) | |
| 310 | 310 | call_rcu(&dst->rcu_head, dst_destroy_rcu); |
| 311 | 311 | } |
| 312 | 312 | } |