]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - fs/gfs2/dir.c
GFS2: gfs2_dir_get_hash_table(): avoiding deferred vfree() is easy here...
[karo-tx-linux.git] / fs / gfs2 / dir.c
index c247fed4a9a63ee2d1dc4460cae91ec57420c850..c5a34f09e228dadc5d9d4b0e316280f0bc98ccb8 100644 (file)
@@ -370,11 +370,12 @@ static __be64 *gfs2_dir_get_hash_table(struct gfs2_inode *ip)
        }
 
        spin_lock(&inode->i_lock);
-       if (ip->i_hash_cache)
-               kvfree(hc);
-       else
+       if (likely(!ip->i_hash_cache)) {
                ip->i_hash_cache = hc;
+               hc = NULL;
+       }
        spin_unlock(&inode->i_lock);
+       kvfree(hc);
 
        return ip->i_hash_cache;
 }