diff options
author | dchagin <dchagin@FreeBSD.org> | 2014-04-12 06:50:11 +0000 |
---|---|---|
committer | dchagin <dchagin@FreeBSD.org> | 2014-04-12 06:50:11 +0000 |
commit | ee7f22ddbc3e408597a35954b56541d3ca754e81 (patch) | |
tree | c0795340b7989f11fea6e74653a0a0ce5856a4ce /sys | |
parent | fde2f5ed5896ea2a315b7483f0f7183e52cccfe8 (diff) | |
download | FreeBSD-src-ee7f22ddbc3e408597a35954b56541d3ca754e81.zip FreeBSD-src-ee7f22ddbc3e408597a35954b56541d3ca754e81.tar.gz |
MFC r264151:
Prevent alq from panic when the invalid alq_file path specified.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_alq.c | 10 |
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); |