[PATCH 017 of 18] knfsd: Don't ignore kstrdup failure in rpc caches.

From: NeilBrown
Date: Thu Dec 07 2006 - 20:15:58 EST




Signed-off-by: Neil Brown <neilb@xxxxxxx>

### Diffstat output
./net/sunrpc/svcauth_unix.c | 4 ++++
1 file changed, 4 insertions(+)

diff .prev/net/sunrpc/svcauth_unix.c ./net/sunrpc/svcauth_unix.c
--- .prev/net/sunrpc/svcauth_unix.c 2006-12-08 12:08:37.000000000 +1100
+++ ./net/sunrpc/svcauth_unix.c 2006-12-08 12:09:31.000000000 +1100
@@ -53,6 +53,10 @@ struct auth_domain *unix_domain_find(cha
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);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/