diff options
author | Jingbo Xu <jefflexu@linux.alibaba.com> | 2023-09-10 00:32:28 +0800 |
---|---|---|
committer | Gao Xiang <hsiangkao@linux.alibaba.com> | 2023-09-11 11:22:05 +0800 |
commit | ff3e9304453e42ac481410b5dcc2026b57131b1f (patch) | |
tree | 51fb5551c95bd86a6e072716d46c1202286d289b | |
parent | 14c4c9cb18a7ac01cf3bf02743daf777b3f5fa82 (diff) | |
download | erofs-utils-ff3e9304453e42ac481410b5dcc2026b57131b1f.tar.gz |
erofs-utils: lib: remove unneeded NULL checks
get_xattritem() will in no way return NULL. Use DBG_BUGONs instead.
Signed-off-by: Jingbo Xu <jefflexu@linux.alibaba.com>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link: https://lore.kernel.org/r/20230909163240.42057-2-hsiangkao@linux.alibaba.com
-rw-r--r-- | lib/xattr.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/xattr.c b/lib/xattr.c index 0cab29f..2b7c634 100644 --- a/lib/xattr.c +++ b/lib/xattr.c @@ -437,8 +437,7 @@ int erofs_setxattr(struct erofs_inode *inode, char *key, item = get_xattritem(prefix, kvbuf, len); if (IS_ERR(item)) return PTR_ERR(item); - if (!item) - return 0; + DBG_BUGON(!item); return erofs_xattr_add(&inode->i_xattrs, item); } @@ -473,8 +472,7 @@ static int erofs_droid_xattr_set_caps(struct erofs_inode *inode) item = get_xattritem(EROFS_XATTR_INDEX_SECURITY, kvbuf, len); if (IS_ERR(item)) return PTR_ERR(item); - if (!item) - return 0; + DBG_BUGON(!item); return erofs_xattr_add(&inode->i_xattrs, item); } |