lkml.org 
[lkml]   [2005]   [Aug]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectuse of uninitialized pointer in jffs_create()
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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-08-21 00:30    [W:0.049 / U:1.648 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site