lkml.org 
[lkml]   [2021]   [Jan]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2] hugetlbfs: Remove useless BUG_ON(!inode) in hugetlbfs_setattr()
Date
When we reach here with inode = NULL, we should have crashed as inode has
already been dereferenced via hstate_inode. So this BUG_ON(!inode) does not
take effect and should be removed.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
fs/hugetlbfs/inode.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index 016c863b493b..79464963f95e 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -759,8 +759,6 @@ static int hugetlbfs_setattr(struct dentry *dentry, struct iattr *attr)
unsigned int ia_valid = attr->ia_valid;
struct hugetlbfs_inode_info *info = HUGETLBFS_I(inode);

- BUG_ON(!inode);
-
error = setattr_prepare(dentry, attr);
if (error)
return error;
--
2.19.1
\
 
 \ /
  Last update: 2021-01-18 12:10    [W:0.026 / U:0.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site