Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 Apr 2014 16:54:48 +0000 (UTC)
From:      Dmitry Chagin <dchagin@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r264151 - head/sys/kern
Message-ID:  <201404051654.s35GsmgT082766@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201404051654.s35GsmgT082766>