[DRBD-cvs] svn commit by phil - r3054 - branches/drbd-8.0/drbd - [Do not propagate] crypto_alloc_hash() has to use the E

drbd-cvs at lists.linbit.com drbd-cvs at lists.linbit.com
Thu Sep 6 17:25:56 CEST 2007


Author: phil
Date: 2007-09-06 17:25:55 +0200 (Thu, 06 Sep 2007)
New Revision: 3054

Modified:
   branches/drbd-8.0/drbd/drbd_compat_wrappers.h
Log:
[Do not propagate]

crypto_alloc_hash() has to use the ERR_PTR() macros for reporting
errors.


Modified: branches/drbd-8.0/drbd/drbd_compat_wrappers.h
===================================================================
--- branches/drbd-8.0/drbd/drbd_compat_wrappers.h	2007-09-06 13:26:43 UTC (rev 3053)
+++ branches/drbd-8.0/drbd/drbd_compat_wrappers.h	2007-09-06 15:25:55 UTC (rev 3054)
@@ -295,11 +295,11 @@
 
 	// "hmac(xxx)" is in alg_name we need that xxx.
 	closing_bracket = strchr(alg_name,')');
-	if(!closing_bracket) return NULL;
-	if(closing_bracket-alg_name < 6) return NULL;
+	if(!closing_bracket) ERR_PTR(-ENOENT);
+	if(closing_bracket-alg_name < 6) return ERR_PTR(-ENOENT);
 
 	ch = kmalloc(sizeof(struct crypto_hash),GFP_KERNEL);
-	if(!ch) return NULL;
+	if(!ch) return ERR_PTR(-ENOMEM);
 
 	*closing_bracket = 0;
 	ch->base = crypto_alloc_tfm(alg_name + 5, 0);
@@ -307,7 +307,7 @@
 
 	if (ch->base == NULL) {
 		kfree(ch);
-		return NULL;
+		return ERR_PTR(-ENOMEM);
 	}
 
 	return ch;



More information about the drbd-cvs mailing list