]> err.no Git - linux-2.6/commitdiff
[CIFS] Add destroy routine for dns_resolver
authorJeff Layton <jlayton@redhat.com>
Wed, 27 Aug 2008 17:53:30 +0000 (17:53 +0000)
committerSteve French <sfrench@us.ibm.com>
Wed, 27 Aug 2008 21:17:41 +0000 (21:17 +0000)
Otherwise, we're leaking the payload memory.

CC: Stable Kernel <stable@vger.kernel.org>
Acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
fs/cifs/CHANGES
fs/cifs/dns_resolve.c

index 526041a52d352c33427957b383fb3e18e99049b0..f9e4ad97a79e708fc27a9896ead78aee49ed396a 100644 (file)
@@ -8,7 +8,8 @@ architectures.  Fix problems with preserving timestamps on copying open
 files (e.g. "cp -a") to Windows servers.  For mkdir and create honor setgid bit
 on parent directory when server supports Unix Extensions but not POSIX
 create. Update cifs.upcall version to handle new Kerberos sec flags
-(this requires update of cifs.upcall program from Samba).
+(this requires update of cifs.upcall program from Samba).  Fix memory leak
+on dns_upcall (resolving DFS referralls).
 
 Version 1.53
 ------------
index f730ef35499e4d93f73aade10da408bcb9053716..a2e0673e1b0873983bee36db6f25d948978e3b06 100644 (file)
@@ -47,11 +47,18 @@ static int dns_resolver_instantiate(struct key *key, const void *data,
        return rc;
 }
 
+static void
+dns_resolver_destroy(struct key *key)
+{
+       kfree(key->payload.data);
+}
+
 struct key_type key_type_dns_resolver = {
        .name        = "dns_resolver",
        .def_datalen = sizeof(struct in_addr),
        .describe    = user_describe,
        .instantiate = dns_resolver_instantiate,
+       .destroy     = dns_resolver_destroy,
        .match       = user_match,
 };