From: Christian Brauner <[email protected]>
To: Dan Carpenter <[email protected]>
Cc: [email protected], [email protected],
[email protected],
Ammar Faizi <[email protected]>,
GNU/Weeb Mailing List <[email protected]>
Subject: Re: [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 14:37:14 +0100 [thread overview]
Message-ID: <20221114133714.sglfhlw7i33avjmt@wittgenstein> (raw)
In-Reply-To: <[email protected]>
On Mon, Nov 14, 2022 at 03:50:41PM +0300, Dan Carpenter wrote:
> 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".
Hey Dan,
Thanks for the report but fwiw, this version of the patchset hasn't made
it. We went with what's in -next currently. So that bug should be gone!
Thank you!
Christian
prev parent reply other threads:[~2022-11-14 13:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-14 12:50 [ammarfaizi2-block:brauner/linux/fs.xattr.simple.rework.rbtree 1/1] fs/xattr.c:1118 simple_xattr_get() error: uninitialized symbol 'ret' Dan Carpenter
2022-11-14 13:37 ` Christian Brauner [this message]
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 \
--in-reply-to=20221114133714.sglfhlw7i33avjmt@wittgenstein \
[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