Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 May 2009 09:52:12 +0000 (UTC)
From:      VANHULLEBUS Yvan <vanhu@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r192883 - head/sys/crypto/via
Message-ID:  <200905270952.n4R9qCJZ090370@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: vanhu
Date: Wed May 27 09:52:12 2009
New Revision: 192883
URL: http://svn.freebsd.org/changeset/base/192883

Log:
  Changed to M_NOWAIT when reallocing psc_buf in padlock_sha_update(),
  as we already hold the non sleepable crypto_driver_mutex.
  
  Approved by:	gnn(mentor)
  Obtained from:	NETASQ
  MFC after:	2 weeks

Modified:
  head/sys/crypto/via/padlock_hash.c

Modified: head/sys/crypto/via/padlock_hash.c
==============================================================================
--- head/sys/crypto/via/padlock_hash.c	Wed May 27 09:44:14 2009	(r192882)
+++ head/sys/crypto/via/padlock_hash.c	Wed May 27 09:52:12 2009	(r192883)
@@ -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?200905270952.n4R9qCJZ090370>