Skip to content

Commit b30c516

Browse files
Eric Dumazetdavem330
authored andcommitted
net: fix __dst_destroy_metrics_generic()
dst_default_metrics is readonly, we dont want to kfree() it later. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 19694ac commit b30c516

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/core/dst.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ void __dst_destroy_metrics_generic(struct dst_entry *dst, unsigned long old)
315315
{
316316
unsigned long prev, new;
317317

318-
new = (unsigned long) dst_default_metrics;
318+
new = ((unsigned long) dst_default_metrics) | DST_METRICS_READ_ONLY;
319319
prev = cmpxchg(&dst->_metrics, old, new);
320320
if (prev == old)
321321
kfree(__DST_METRICS_PTR(old));

0 commit comments

Comments
 (0)