2007-10-19 14:05:37

by Adrian Bunk

[permalink] [raw]
Subject: [2.6 patch] fs/9p/v9fs.c: memleak fix

This patch fixes a memory leak introduced by
commit ba17674fe02909fef049fd4b620a2805bdb8c693.

Spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <[email protected]>

---
--- linux-2.6/fs/9p/v9fs.c.old 2007-10-19 15:56:06.000000000 +0200
+++ linux-2.6/fs/9p/v9fs.c 2007-10-19 15:57:00.000000000 +0200
@@ -152,26 +152,27 @@ static void v9fs_parse_options(struct v9
case Opt_access:
s = match_strdup(&args[0]);
v9ses->flags &= ~V9FS_ACCESS_MASK;
if (strcmp(s, "user") == 0)
v9ses->flags |= V9FS_ACCESS_USER;
else if (strcmp(s, "any") == 0)
v9ses->flags |= V9FS_ACCESS_ANY;
else {
v9ses->flags |= V9FS_ACCESS_SINGLE;
v9ses->uid = simple_strtol(s, &e, 10);
if (*e != '\0')
v9ses->uid = ~0;
}
+ kfree(s);
break;

default:
continue;
}
}
}

/**
* v9fs_session_init - initialize session
* @v9ses: session information structure
* @dev_name: device being mounted
* @data: options


2007-10-23 22:31:13

by Eric Van Hensbergen

[permalink] [raw]
Subject: Re: [2.6 patch] fs/9p/v9fs.c: memleak fix

On 10/19/07, Adrian Bunk <[email protected]> wrote:
> This patch fixes a memory leak introduced by
> commit ba17674fe02909fef049fd4b620a2805bdb8c693.
>
> Spotted by the Coverity checker.
>
> Signed-off-by: Adrian Bunk <[email protected]>
Acked-by: Eric Van Hensbergen <[email protected]>