summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/dev.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/dev.c b/src/lib/dev.c
index 6dbb925e..3c1494ee 100644
--- a/src/lib/dev.c
+++ b/src/lib/dev.c
@@ -1403,7 +1403,10 @@ int ipcp_flow_write(int fd,
pthread_rwlock_rdlock(&ai.lock);
- assert(flow->flow_id >= 0);
+ if (flow->flow_id < 0) {
+ pthread_rwlock_unlock(&ai.lock);
+ return -ENOTALLOC;
+ }
if ((flow->oflags & FLOWFACCMODE) == FLOWFRDONLY) {
pthread_rwlock_unlock(&ai.lock);