Re: [PATCH] befs: fix sparse warning in linuxvfs.c

Previous thread: Linux i386 clone(): %ebx 'frobbing' ? by Ahmed S. Darwish on Friday, February 15, 2008 - 2:42 pm. (5 messages)

Next thread: [RFC-PATCH] fuse: shadowed variable warning by Harvey Harrison on Friday, February 15, 2008 - 2:58 pm. (3 messages)
To: Sergey S. Kostyliov <rathamahata@...>, Andrew Morton <akpm@...>
Cc: LKML <linux-kernel@...>
Date: Friday, February 15, 2008 - 2:46 pm

Use link as the variable name to avoid shadowing the arg.

fs/befs/linuxvfs.c:492:8: warning: symbol 'p' shadows an earlier one
fs/befs/linuxvfs.c:488:77: originally declared here

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
---
This should be checked in case there is a latent bug here. Should it
be the arg *p getting freed, or the local var *p that was shadowing
it?

fs/befs/linuxvfs.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c
index 82123ff..e8717de 100644
--- a/fs/befs/linuxvfs.c
+++ b/fs/befs/linuxvfs.c
@@ -489,9 +489,9 @@ static void befs_put_link(struct dentry *dentry, struct nameidata *nd, void *p)
{
befs_inode_info *befs_ino = BEFS_I(dentry->d_inode);
if (befs_ino->i_flags & BEFS_LONG_SYMLINK) {
- char *p = nd_get_link(nd);
- if (!IS_ERR(p))
- kfree(p);
+ char *link = nd_get_link(nd);
+ if (!IS_ERR(link))
+ kfree(link);
}
}

--
1.5.4.1.1278.gc75be

--

To: Harvey Harrison <harvey.harrison@...>
Cc: <rathamahata@...>, <linux-kernel@...>
Date: Friday, February 15, 2008 - 5:19 pm

On Fri, 15 Feb 2008 10:46:04 -0800

The code looks OK - the name was allocated in befs_follow_link() and was
--

To: Andrew Morton <akpm@...>
Cc: <rathamahata@...>, <linux-kernel@...>
Date: Friday, February 15, 2008 - 5:23 pm

OK, that's as far as I got as well, but don't know the area well enough
to be sure, hence the caveat.

Harvey

--

Previous thread: Linux i386 clone(): %ebx 'frobbing' ? by Ahmed S. Darwish on Friday, February 15, 2008 - 2:42 pm. (5 messages)

Next thread: [RFC-PATCH] fuse: shadowed variable warning by Harvey Harrison on Friday, February 15, 2008 - 2:58 pm. (3 messages)