From: NeilBrown Date: Wed, 13 Dec 2006 08:35:44 +0000 (-0800) Subject: [PATCH] knfsd: Don't ignore kstrdup failure in rpc caches X-Git-Tag: v6.6-pxa1908~56981 X-Git-Url: https://git.dujemihanovic.xyz/?a=commitdiff_plain;h=dd08d6ea443abafe9455997d2889719364b8794b;p=linux.git [PATCH] knfsd: Don't ignore kstrdup failure in rpc caches Signed-off-by: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c index 177f81608cfb..0d1e8fb83b93 100644 --- a/net/sunrpc/svcauth_unix.c +++ b/net/sunrpc/svcauth_unix.c @@ -53,6 +53,10 @@ struct auth_domain *unix_domain_find(char *name) return NULL; kref_init(&new->h.ref); new->h.name = kstrdup(name, GFP_KERNEL); + if (new->h.name == NULL) { + kfree(new); + return NULL; + } new->h.flavour = &svcauth_unix; new->addr_changes = 0; rv = auth_domain_lookup(name, &new->h);