aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander V. Chernikov <melifaro@FreeBSD.org>2021-03-21 18:15:29 +0000
committerAlexander V. Chernikov <melifaro@FreeBSD.org>2021-03-25 20:07:42 +0000
commit42f997d9b721ce5b64c37958f21fa81630f5a224 (patch)
treef410099b8c14c4a2d79ee145e237293d9dbf94ad
parent280d35ab5b2da45f3f52ef135b3b5f7c529e4392 (diff)
downloadsrc-42f997d9b721ce5b64c37958f21fa81630f5a224.tar.gz
src-42f997d9b721ce5b64c37958f21fa81630f5a224.zip
Fix kassert panic when inserting multipath routes from multiple threads.
Reported by: Marco Zec <zec at fer.hr> (cherry picked from commit 2476178e6b09acc8d0fe6b1fb9c1b6f2981f766e)
-rw-r--r--sys/net/route/nhgrp_ctl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/net/route/nhgrp_ctl.c b/sys/net/route/nhgrp_ctl.c
index c2119506370f..b329b907144f 100644
--- a/sys/net/route/nhgrp_ctl.c
+++ b/sys/net/route/nhgrp_ctl.c
@@ -488,7 +488,9 @@ get_nhgrp(struct nh_control *ctl, struct weightened_nhop *wn, int num_nhops,
if (link_nhgrp(ctl, key) == 0) {
/* Unable to allocate index? */
*perror = EAGAIN;
- destroy_nhgrp(key);
+ free_nhgrp_nhops(key);
+ destroy_nhgrp_int(key);
+ return (NULL);
}
*perror = 0;
return (key);