public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jesper Juhl <jesper.juhl@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: jffs-dev@axis.com
Subject: use of uninitialized pointer in jffs_create()
Date: Sun, 21 Aug 2005 00:28:08 +0200	[thread overview]
Message-ID: <9a87484905082015284c1686ec@mail.gmail.com> (raw)

gcc kindly pointed me at jffs_create() with this warning : 

fs/jffs/inode-v23.c:1279: warning: `inode' might be used uninitialized
in this function

And looking at the function :

static int
jffs_create(struct inode *dir, struct dentry *dentry, int mode,
                struct nameidata *nd)
{
        struct jffs_raw_inode raw_inode;
        struct jffs_control *c;
        struct jffs_node *node;
        struct jffs_file *dir_f; /* JFFS representation of the directory.  */
        struct inode *inode;
        int err;

        truncate_inode_pages(&inode->i_data, 0);
...

I think it is correct. How on earth is that call to
truncate_inode_pages() going to avoid blowing up? inode has not yet
been initialized... Looks like a bug to me.
Unfortunately I don't know anything about this code, so I haven't
attempted to fix it.

-- 
Jesper Juhl <jesper.juhl@gmail.com>
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please      http://www.expita.com/nomime.html

             reply	other threads:[~2005-08-20 22:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-20 22:28 Jesper Juhl [this message]
2005-08-21  9:14 ` use of uninitialized pointer in jffs_create() Alexey Dobriyan
2005-08-21 11:47   ` Jesper Juhl
2005-08-22  5:21     ` Stephane Wirtel
2005-08-22 10:45 ` Jörn Engel
2005-08-22 23:07   ` Adrian Bunk
2005-08-23  9:07     ` Jörn Engel

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=9a87484905082015284c1686ec@mail.gmail.com \
    --to=jesper.juhl@gmail.com \
    --cc=jffs-dev@axis.com \
    --cc=linux-kernel@vger.kernel.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox