All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kernel-janitors@vger.kernel.org
Subject: [bug report] kernfs: Add option to enable user xattrs
Date: Wed, 08 Apr 2020 11:14:56 +0000	[thread overview]
Message-ID: <20200408111456.GA250869@mwanda> (raw)

Hello Daniel Xu,

The patch 0c47383ba3bd: "kernfs: Add option to enable user xattrs"
from Mar 12, 2020, leads to the following static checker warning:

	fs/kernfs/inode.c:379 kernfs_vfs_user_xattr_rm()
	error: uninitialized symbol 'removed_size'.

fs/kernfs/inode.c
   366  static int kernfs_vfs_user_xattr_rm(struct kernfs_node *kn,
   367                                      const char *full_name,
   368                                      struct simple_xattrs *xattrs,
   369                                      const void *value, size_t size, int flags)
   370  {
   371          atomic_t *sz = &kn->iattr->user_xattr_size;
   372          atomic_t *nr = &kn->iattr->nr_user_xattrs;
   373          ssize_t removed_size;
   374          int ret;
   375  
   376          ret = simple_xattr_set(xattrs, full_name, value, size, flags,
   377                                 &removed_size);
   378  
   379          if (removed_size >= 0) {
                    ^^^^^^^^^^^^^^^^^
There are some path where simple_xattr_set() doesn't initialize
"removed_size" on allocation failure.

   380                  atomic_sub(removed_size, sz);
   381                  atomic_dec(nr);
   382          }
   383  
   384          return ret;
   385  }

regards,
dan carpenter

                 reply	other threads:[~2020-04-08 11:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20200408111456.GA250869@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.