we use base before checking if it is NULL

Signed-off-by: Oleksij Rempel <[email protected]>
---
 fs/fs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/fs.c b/fs/fs.c
index 42fd63ad0..625ed10b7 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -1526,7 +1526,7 @@ static struct dentry *__lookup_hash(const struct qstr 
*name,
 {
        struct dentry *dentry;
        struct dentry *old;
-       struct inode *dir = base->d_inode;
+       struct inode *dir;
 
        if (!base)
                return ERR_PTR(-ENOENT);
@@ -1539,6 +1539,7 @@ static struct dentry *__lookup_hash(const struct qstr 
*name,
        if (unlikely(!dentry))
                return ERR_PTR(-ENOMEM);
 
+       dir = base->d_inode;
        old = dir->i_op->lookup(dir, dentry, flags);
        if (IS_ERR(old)) {
                dput(dentry);
-- 
2.17.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

Reply via email to