Skip to content

Commit

Permalink
ceph: dereference pointer after checking for NULL
Browse files Browse the repository at this point in the history
moved dereference after BUG_ON

Signed-off-by: Yehuda Sadeh <[email protected]>
  • Loading branch information
Yehuda Sadeh authored and liewegas committed Jan 10, 2012
1 parent e11b05d commit b8cd952
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/ceph/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -851,11 +851,12 @@ static void ceph_set_dentry_offset(struct dentry *dn)
{
struct dentry *dir = dn->d_parent;
struct inode *inode = dir->d_inode;
struct ceph_inode_info *ci = ceph_inode(inode);
struct ceph_inode_info *ci;
struct ceph_dentry_info *di;

BUG_ON(!inode);

ci = ceph_inode(inode);
di = ceph_dentry(dn);

spin_lock(&ci->i_ceph_lock);
Expand Down

0 comments on commit b8cd952

Please sign in to comment.