diff options
-rw-r--r-- | sys/netinet/ip_dummynet.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/netinet/ip_dummynet.c b/sys/netinet/ip_dummynet.c index 821b69b..2559c7e 100644 --- a/sys/netinet/ip_dummynet.c +++ b/sys/netinet/ip_dummynet.c @@ -1616,6 +1616,7 @@ config_pipe(struct dn_pipe *p) if (b == NULL || b->pipe_nr != p->pipe_nr) { /* new pipe */ x = malloc(sizeof(struct dn_pipe), M_DUMMYNET, M_NOWAIT | M_ZERO); if (x == NULL) { + DUMMYNET_UNLOCK(); printf("dummynet: no memory for new pipe\n"); return ENOSPC; } @@ -1664,8 +1665,10 @@ config_pipe(struct dn_pipe *p) a = b , b = b->next) ; if (b == NULL || b->fs_nr != pfs->fs_nr) { /* new */ - if (pfs->parent_nr == 0) /* need link to a pipe */ + if (pfs->parent_nr == 0) { /* need link to a pipe */ + DUMMYNET_UNLOCK(); return EINVAL ; + } x = malloc(sizeof(struct dn_flow_set), M_DUMMYNET, M_NOWAIT|M_ZERO); if (x == NULL) { DUMMYNET_UNLOCK(); @@ -1681,8 +1684,10 @@ config_pipe(struct dn_pipe *p) x->weight = 100 ; } else { /* Change parent pipe not allowed; must delete and recreate */ - if (pfs->parent_nr != 0 && b->parent_nr != pfs->parent_nr) + if (pfs->parent_nr != 0 && b->parent_nr != pfs->parent_nr) { + DUMMYNET_UNLOCK(); return EINVAL ; + } x = b; } set_fs_parms(x, pfs); |