summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_alq.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/kern_alq.c')
-rw-r--r--sys/kern/kern_alq.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/kern/kern_alq.c b/sys/kern/kern_alq.c
index 1e6fcf7..7f8c603 100644
--- a/sys/kern/kern_alq.c
+++ b/sys/kern/kern_alq.c
@@ -488,10 +488,12 @@ alq_open(struct alq **alqp, const char *file, struct ucred *cred, int cmode,
KASSERT((count >= 0), ("%s: count < 0", __func__));
if (count > 0) {
- ret = alq_open_flags(alqp, file, cred, cmode, size*count, 0);
- (*alqp)->aq_flags |= AQ_LEGACY;
- (*alqp)->aq_entmax = count;
- (*alqp)->aq_entlen = size;
+ if ((ret = alq_open_flags(alqp, file, cred, cmode,
+ size*count, 0)) == 0) {
+ (*alqp)->aq_flags |= AQ_LEGACY;
+ (*alqp)->aq_entmax = count;
+ (*alqp)->aq_entlen = size;
+ }
} else
ret = alq_open_flags(alqp, file, cred, cmode, size, 0);
OpenPOWER on IntegriCloud