From: "J. Bruce Fields" <bfields@fieldses.org>

Oops; forgot to check return value from kmalloc, and missed the same
problem in two other spots.  Incremental patch against the previous fix.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/net/sunrpc/svcauth_unix.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff -puN net/sunrpc/svcauth_unix.c~auth_unix_lookup-oops-fix-fix net/sunrpc/svcauth_unix.c
--- 25/net/sunrpc/svcauth_unix.c~auth_unix_lookup-oops-fix-fix	Tue Aug 24 15:55:51 2004
+++ 25-akpm/net/sunrpc/svcauth_unix.c	Tue Aug 24 15:55:51 2004
@@ -307,6 +307,8 @@ struct auth_domain *auth_unix_lookup(str
 	struct auth_domain *rv;
 
 	key.m_class = strdup("nfsd");
+	if (!key.m_class)
+		return NULL;
 	key.m_addr = addr;
 
 	ipm = ip_map_lookup(&key, 0);
@@ -369,10 +371,13 @@ svcauth_null_accept(struct svc_rqst *rqs
 	svc_putu32(resv, RPC_AUTH_NULL);
 	svc_putu32(resv, 0);
 
-	key.m_class = rqstp->rq_server->sv_program->pg_class;
+	key.m_class = strdup(rqstp->rq_server->sv_program->pg_class);
+	if (!key.m_class)
+		return SVC_DROP;
 	key.m_addr = rqstp->rq_addr.sin_addr;
 
 	ipm = ip_map_lookup(&key, 0);
+	kfree(key.m_class);
 
 	rqstp->rq_client = NULL;
 
@@ -465,11 +470,14 @@ svcauth_unix_accept(struct svc_rqst *rqs
 	}
 
 
-	key.m_class = rqstp->rq_server->sv_program->pg_class;
+	key.m_class = strdup(rqstp->rq_server->sv_program->pg_class);
+	if (!key.m_class)
+		return SVC_DROP;
 	key.m_addr = rqstp->rq_addr.sin_addr;
 
 
 	ipm = ip_map_lookup(&key, 0);
+	kfree(key.m_class);
 
 	if (ipm)
 		switch (cache_check(&ip_map_cache, &ipm->h, &rqstp->rq_chandle)) {
_