Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Jun 2009 13:48:31 +0000 (UTC)
From:      VANHULLEBUS Yvan <vanhu@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r194238 - in stable/7/sys: . contrib/pf crypto/via dev/ath/ath_hal
Message-ID:  <200906151348.n5FDmVda091395@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: vanhu
Date: Mon Jun 15 13:48:31 2009
New Revision: 194238
URL: http://svn.freebsd.org/changeset/base/194238

Log:
  MFC: Changed to M_NOWAIT when reallocing psc_buf in padlock_sha_update(),
   as we already hold the non sleepable crypto_driver_mutex.
  
  Obtained from:	NETASQ

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/crypto/via/padlock_hash.c
  stable/7/sys/dev/ath/ath_hal/   (props changed)

Modified: stable/7/sys/crypto/via/padlock_hash.c
==============================================================================
--- stable/7/sys/crypto/via/padlock_hash.c	Mon Jun 15 13:47:49 2009	(r194237)
+++ stable/7/sys/crypto/via/padlock_hash.c	Mon Jun 15 13:48:31 2009	(r194238)
@@ -171,7 +171,9 @@ padlock_sha_update(struct padlock_sha_ct
 	if (ctx->psc_size - ctx->psc_offset < bufsize) {
 		ctx->psc_size = MAX(ctx->psc_size * 2, ctx->psc_size + bufsize);
 		ctx->psc_buf = realloc(ctx->psc_buf, ctx->psc_size, M_PADLOCK,
-		    M_WAITOK);
+		    M_NOWAIT);
+		if(ctx->psc_buf == NULL)
+			return (ENOMEM);
 	}
 	bcopy(buf, ctx->psc_buf + ctx->psc_offset, bufsize);
 	ctx->psc_offset += bufsize;



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