* [patch 3/3] btrfs cleanup: unneeded null check
@ 2010-03-20 11:37 ` Dan Carpenter
0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2010-03-20 11:37 UTC (permalink / raw)
To: Chris Mason
Cc: Josef Bacik, Yan Zheng, Andrew Morton, linux-btrfs, linux-kernel,
kernel-janitors
old_inode cannot be null here so I removed the check.
This fixes a smatch warning:
fs/btrfs/inode.c +5545 btrfs_rename(88) warn: variable dereferenced
before check 'old_inode'
Signed-off-by: Dan Carpenter <error27@gmail.com>
---
linux-next material
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 02bb099..647ce41 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -5541,10 +5541,8 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry,
* make sure the inode gets flushed if it is replacing
* something.
*/
- if (new_inode && new_inode->i_size &&
- old_inode && S_ISREG(old_inode->i_mode)) {
+ if (new_inode && new_inode->i_size && S_ISREG(old_inode->i_mode))
btrfs_add_ordered_operation(trans, root, old_inode);
- }
old_dir->i_ctime = old_dir->i_mtime = ctime;
new_dir->i_ctime = new_dir->i_mtime = ctime;
^ permalink raw reply related [flat|nested] 2+ messages in thread* [patch 3/3] btrfs cleanup: unneeded null check
@ 2010-03-20 11:37 ` Dan Carpenter
0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2010-03-20 11:37 UTC (permalink / raw)
To: Chris Mason
Cc: Josef Bacik, Yan Zheng, Andrew Morton, linux-btrfs, linux-kernel,
kernel-janitors
old_inode cannot be null here so I removed the check.
This fixes a smatch warning:
fs/btrfs/inode.c +5545 btrfs_rename(88) warn: variable dereferenced
before check 'old_inode'
Signed-off-by: Dan Carpenter <error27@gmail.com>
---
linux-next material
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 02bb099..647ce41 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -5541,10 +5541,8 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry,
* make sure the inode gets flushed if it is replacing
* something.
*/
- if (new_inode && new_inode->i_size &&
- old_inode && S_ISREG(old_inode->i_mode)) {
+ if (new_inode && new_inode->i_size && S_ISREG(old_inode->i_mode))
btrfs_add_ordered_operation(trans, root, old_inode);
- }
old_dir->i_ctime = old_dir->i_mtime = ctime;
new_dir->i_ctime = new_dir->i_mtime = ctime;
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-03-20 11:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-20 11:37 [patch 3/3] btrfs cleanup: unneeded null check Dan Carpenter
2010-03-20 11:37 ` Dan Carpenter
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.