svn commit: r264365 - stable/9/sys/kern

Dmitry Chagin dchagin at FreeBSD.org
Sat Apr 12 06:49:11 UTC 2014


Author: dchagin
Date: Sat Apr 12 06:49:10 2014
New Revision: 264365
URL: http://svnweb.freebsd.org/changeset/base/264365

Log:
  MFC r264151:
  
  Prevent alq from panic when the invalid alq_file path specified.

Modified:
  stable/9/sys/kern/kern_alq.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/kern/kern_alq.c
==============================================================================
--- stable/9/sys/kern/kern_alq.c	Sat Apr 12 02:05:31 2014	(r264364)
+++ stable/9/sys/kern/kern_alq.c	Sat Apr 12 06:49:10 2014	(r264365)
@@ -494,10 +494,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-stable-9 mailing list