Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 53b27584 authored by Davi Arnaut's avatar Davi Arnaut Committed by Linus Torvalds
Browse files

[PATCH] smbfs: 'names_cache' memory leak



Data allocated with "__getname()" should always be free'd with "__putname()"
because of the AUDITSYSCALL code.

Signed-off-by: default avatarDavi Arnaut <davi.arnaut@gmail.com>
Cc: Urban Widmark <urban@teststation.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent ce44eeb6
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ static void *smb_follow_link(struct dentry *dentry, struct nameidata *nd)
		int len = smb_proc_read_link(server_from_dentry(dentry),
						dentry, link, PATH_MAX - 1);
		if (len < 0) {
			putname(link);
			__putname(link);
			link = ERR_PTR(len);
		} else {
			link[len] = 0;
@@ -59,7 +59,7 @@ static void smb_put_link(struct dentry *dentry, struct nameidata *nd, void *p)
{
	char *s = nd_get_link(nd);
	if (!IS_ERR(s))
		putname(s);
		__putname(s);
}

struct inode_operations smb_link_inode_operations =