* [PATCH] btrfs: fix dereference of ERR_PTR value
@ 2011-06-13 17:54 David Sterba
0 siblings, 0 replies; only message in thread
From: David Sterba @ 2011-06-13 17:54 UTC (permalink / raw)
To: linux-btrfs; +Cc: chris.mason, David Sterba
smatch reports:
btrfs_recover_log_trees error: 'wc.replay_dest' dereferencing
possible ERR_PTR()
Signed-off-by: David Sterba <dsterba@suse.cz>
---
fs/btrfs/tree-log.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index 592396c..4ce8a9f 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -3177,7 +3177,7 @@ again:
tmp_key.offset = (u64)-1;
wc.replay_dest = btrfs_read_fs_root_no_name(fs_info, &tmp_key);
- BUG_ON(!wc.replay_dest);
+ BUG_ON(IS_ERR_OR_NULL(wc.replay_dest));
wc.replay_dest->log_root = log;
btrfs_record_root_in_trans(trans, wc.replay_dest);
--
1.7.5.2.353.g5df3e
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2011-06-13 17:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-13 17:54 [PATCH] btrfs: fix dereference of ERR_PTR value David Sterba
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).