* [bug report] kernfs: Add option to enable user xattrs
@ 2020-04-08 11:14 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2020-04-08 11:14 UTC (permalink / raw)
To: kernel-janitors
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-04-08 11:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-08 11:14 [bug report] kernfs: Add option to enable user xattrs Dan Carpenter
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.