diff options
author | mlaier <mlaier@FreeBSD.org> | 2004-03-03 01:33:22 +0000 |
---|---|---|
committer | mlaier <mlaier@FreeBSD.org> | 2004-03-03 01:33:22 +0000 |
commit | 206b5dcf52404648c53b71b3cd1ab0cd84426bbb (patch) | |
tree | 1b69111245842baa947c8f07155a1769500a99c3 /sys/netinet/ip_dummynet.c | |
parent | b1c5030770100ae49ea35cbd383b7db21f5e345e (diff) | |
download | FreeBSD-src-206b5dcf52404648c53b71b3cd1ab0cd84426bbb.zip FreeBSD-src-206b5dcf52404648c53b71b3cd1ab0cd84426bbb.tar.gz |
Add some missing DUMMYNET_UNLOCK() in config_pipe().
Noticed by: Simon Coggins
Approved by: bms(mentor)
Diffstat (limited to 'sys/netinet/ip_dummynet.c')
-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); |