[ext4:unicode 8/10] fs/ext4/hash.c:286 ext4fs_dirhash() warn: returning -1 instead of -ENOMEM is sloppy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git unicode
head:   c0ae3a05c89c497446d6e208b68623993b5afc3c
commit: 6ca9bcdef8a4bc83fe8499ab47e29b849ea94bfb [8/10] ext4: support encoding-aware file name lookups

smatch warnings:
fs/ext4/hash.c:286 ext4fs_dirhash() warn: returning -1 instead of -ENOMEM is sloppy

# https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git/commit/?id=6ca9bcdef8a4bc83fe8499ab47e29b849ea94bfb
git remote add ext4 https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git
git remote update ext4
git checkout 6ca9bcdef8a4bc83fe8499ab47e29b849ea94bfb
vim +286 fs/ext4/hash.c

6ca9bcdef Gabriel Krisman Bertazi 2019-03-18  273  
6ca9bcdef Gabriel Krisman Bertazi 2019-03-18  274  int ext4fs_dirhash(const struct inode *dir, const char *name, int len,
6ca9bcdef Gabriel Krisman Bertazi 2019-03-18  275  		   struct dx_hash_info *hinfo)
6ca9bcdef Gabriel Krisman Bertazi 2019-03-18  276  {
6ca9bcdef Gabriel Krisman Bertazi 2019-03-18  277  #ifdef CONFIG_UNICODE
6ca9bcdef Gabriel Krisman Bertazi 2019-03-18  278  	const struct unicode_map *um = EXT4_SB(dir->i_sb)->s_encoding;
6ca9bcdef Gabriel Krisman Bertazi 2019-03-18  279  	int r, dlen;
6ca9bcdef Gabriel Krisman Bertazi 2019-03-18  280  	unsigned char *buff;
6ca9bcdef Gabriel Krisman Bertazi 2019-03-18  281  	struct qstr qstr = {.name = name, .len = len };
6ca9bcdef Gabriel Krisman Bertazi 2019-03-18  282  
6ca9bcdef Gabriel Krisman Bertazi 2019-03-18  283  	if (len && um) {
6ca9bcdef Gabriel Krisman Bertazi 2019-03-18  284  		buff = kzalloc(sizeof(char) * PATH_MAX, GFP_KERNEL);
6ca9bcdef Gabriel Krisman Bertazi 2019-03-18  285  		if (!buff)
6ca9bcdef Gabriel Krisman Bertazi 2019-03-18 @286  			return -1;

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation



[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux