From: Dan Carpenter <[email protected]>
To: [email protected], Christian Brauner <[email protected]>
Cc: [email protected], [email protected],
Ammar Faizi <[email protected]>,
GNU/Weeb Mailing List <[email protected]>
Subject: [ammarfaizi2-block:brauner/linux/fs.xattr.simple.rework.rbtree 1/1] fs/xattr.c:1118 simple_xattr_get() error: uninitialized symbol 'ret'.
Date: Mon, 14 Nov 2022 15:50:41 +0300 [thread overview]
Message-ID: <[email protected]> (raw)
tree: https://github.com/ammarfaizi2/linux-block brauner/linux/fs.xattr.simple.rework.rbtree
head: b1999797db0738e60ae9730fcdd5ec6dd7604cd0
commit: b1999797db0738e60ae9730fcdd5ec6dd7604cd0 [1/1] xattr: use rbtree for simple_xattrs
config: m68k-randconfig-m041-20221110
compiler: m68k-linux-gcc (GCC) 12.1.0
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <[email protected]>
| Reported-by: Dan Carpenter <[email protected]>
smatch warnings:
fs/xattr.c:1118 simple_xattr_get() error: uninitialized symbol 'ret'.
vim +/ret +1118 fs/xattr.c
38f38657444d15 Aristeu Rozanski 2012-08-23 1086 int simple_xattr_get(struct simple_xattrs *xattrs, const char *name,
38f38657444d15 Aristeu Rozanski 2012-08-23 1087 void *buffer, size_t size)
38f38657444d15 Aristeu Rozanski 2012-08-23 1088 {
b1999797db0738 Christian Brauner 2022-11-04 1089 struct simple_xattr *xattr = NULL;
b1999797db0738 Christian Brauner 2022-11-04 1090 struct rb_node *rbp;
b1999797db0738 Christian Brauner 2022-11-04 1091 int ret, seq = 0;
b1999797db0738 Christian Brauner 2022-11-04 1092
b1999797db0738 Christian Brauner 2022-11-04 1093 rcu_read_lock();
b1999797db0738 Christian Brauner 2022-11-04 1094 do {
b1999797db0738 Christian Brauner 2022-11-04 1095 read_seqbegin_or_lock(&xattrs->lock, &seq);
b1999797db0738 Christian Brauner 2022-11-04 1096 rbp = rcu_dereference(xattrs->rb_root.rb_node);
b1999797db0738 Christian Brauner 2022-11-04 1097 while (rbp) {
b1999797db0738 Christian Brauner 2022-11-04 1098 xattr = rb_entry(rbp, struct simple_xattr, rb_node);
b1999797db0738 Christian Brauner 2022-11-04 1099 if (strcmp(xattr->name, name) < 0) {
b1999797db0738 Christian Brauner 2022-11-04 1100 rbp = rcu_dereference(rbp->rb_left);
b1999797db0738 Christian Brauner 2022-11-04 1101 } else if (strcmp(xattr->name, name) > 0) {
b1999797db0738 Christian Brauner 2022-11-04 1102 rbp = rcu_dereference(rbp->rb_right);
b1999797db0738 Christian Brauner 2022-11-04 1103 } else {
38f38657444d15 Aristeu Rozanski 2012-08-23 1104 ret = xattr->size;
38f38657444d15 Aristeu Rozanski 2012-08-23 1105 if (buffer) {
38f38657444d15 Aristeu Rozanski 2012-08-23 1106 if (size < xattr->size)
38f38657444d15 Aristeu Rozanski 2012-08-23 1107 ret = -ERANGE;
38f38657444d15 Aristeu Rozanski 2012-08-23 1108 else
38f38657444d15 Aristeu Rozanski 2012-08-23 1109 memcpy(buffer, xattr->value, xattr->size);
38f38657444d15 Aristeu Rozanski 2012-08-23 1110 }
38f38657444d15 Aristeu Rozanski 2012-08-23 1111 break;
"ret" is only initialized if we find "xattr->name == name".
38f38657444d15 Aristeu Rozanski 2012-08-23 1112 }
b1999797db0738 Christian Brauner 2022-11-04 1113 }
b1999797db0738 Christian Brauner 2022-11-04 1114 } while (need_seqretry(&xattrs->lock, seq));
b1999797db0738 Christian Brauner 2022-11-04 1115 done_seqretry(&xattrs->lock, seq);
b1999797db0738 Christian Brauner 2022-11-04 1116 rcu_read_unlock();
b1999797db0738 Christian Brauner 2022-11-04 1117
38f38657444d15 Aristeu Rozanski 2012-08-23 @1118 return ret;
38f38657444d15 Aristeu Rozanski 2012-08-23 1119 }
--
0-DAY CI Kernel Test Service
https://01.org/lkp
next reply other threads:[~2022-11-14 12:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-14 12:50 Dan Carpenter [this message]
2022-11-14 13:37 ` [ammarfaizi2-block:brauner/linux/fs.xattr.simple.rework.rbtree 1/1] fs/xattr.c:1118 simple_xattr_get() error: uninitialized symbol 'ret' Christian Brauner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox