svn commit: r264151 - head/sys/kern
Dmitry Chagin
dchagin at FreeBSD.org
Sat Apr 5 16:54:48 UTC 2014
Author: dchagin
Date: Sat Apr 5 16:54:47 2014
New Revision: 264151
URL: http://svnweb.freebsd.org/changeset/base/264151
Log:
Prevent alq from panic when the invalid alq_file path specified.
MFC after: 1 week
Modified:
head/sys/kern/kern_alq.c
Modified: head/sys/kern/kern_alq.c
==============================================================================
--- head/sys/kern/kern_alq.c Sat Apr 5 16:38:27 2014 (r264150)
+++ head/sys/kern/kern_alq.c Sat Apr 5 16:54:47 2014 (r264151)
@@ -488,10 +488,12 @@ alq_open(struct alq **alqp, const char *
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);
More information about the svn-src-all
mailing list