LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Harvey Harrison <harvey.harrison@gmail.com>
Cc: rathamahata@php4.ru, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] befs: fix sparse warning in linuxvfs.c
Date: Fri, 15 Feb 2008 13:19:22 -0800 [thread overview]
Message-ID: <20080215131922.0d0dcb08.akpm@linux-foundation.org> (raw)
In-Reply-To: <1203101164.15275.21.camel@brick>
On Fri, 15 Feb 2008 10:46:04 -0800
Harvey Harrison <harvey.harrison@gmail.com> wrote:
> 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?
>
The code looks OK - the name was allocated in befs_follow_link() and was
saved away with nd_set_link().
>
> 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
>
>
next prev parent reply other threads:[~2008-02-15 21:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-15 18:46 Harvey Harrison
2008-02-15 21:19 ` Andrew Morton [this message]
2008-02-15 21:23 ` Harvey Harrison
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080215131922.0d0dcb08.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=harvey.harrison@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rathamahata@php4.ru \
--subject='Re: [PATCH] befs: fix sparse warning in linuxvfs.c' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).