Skip to content

Commit

Permalink
[CIFS] Add destroy routine for dns_resolver
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
jtlayton authored and Steve French committed Aug 27, 2008
1 parent 96c2a11 commit 87ed1d6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/cifs/CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -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
------------
Expand Down
7 changes: 7 additions & 0 deletions fs/cifs/dns_resolve.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

Expand Down

0 comments on commit 87ed1d6

Please sign in to comment.