[PATCH v2 0/5] Fix scan-build warnings

Dominique Martinet posted 5 patches 2 years, 7 months ago
fs/9p/vfs_dir.c        |  5 +++--
fs/9p/vfs_inode.c      |  6 ------
fs/9p/vfs_inode_dotl.c |  1 -
net/9p/client.c        | 46 ++++++++++++----------------------------------
net/9p/trans_virtio.c  |  8 ++++----
5 files changed, 19 insertions(+), 47 deletions(-)
[PATCH v2 0/5] Fix scan-build warnings
Posted by Dominique Martinet 2 years, 7 months ago
I ran scan-build very crudly on our source files, and there was at least
one real bug so we might as well run it once in a while, in which case
we probably ought to also fix the less important things hence this
series.
In here the first patch is a real fix and the rest is low priority, the
last one is arguably not an improvement and can be discussed (happy to
just move the 0-initializations around to variable declaration which
would also silence scan-build afaict)

Anyway, it can probably all wait until after this merge, sorry for the
timing.

Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
---
Changes in v2:
- Add Fixes tag to first patch (wasn't the one suggested but a very
  recent commit, still in -next)
- Fix typo in commit messages
- Link to v1: https://lore.kernel.org/r/20230427-scan-build-v1-0-efa05d65e2da@codewreck.org

---
Dominique Martinet (5):
      9p: fix ignored return value in v9fs_dir_release
      9p: virtio: fix unlikely null pointer deref in handle_rerror
      9p: virtio: make sure 'offs' is initialized in zc_request
      9p: virtio: skip incrementing unused variable
      9p: remove dead stores (variable set again without being read)

 fs/9p/vfs_dir.c        |  5 +++--
 fs/9p/vfs_inode.c      |  6 ------
 fs/9p/vfs_inode_dotl.c |  1 -
 net/9p/client.c        | 46 ++++++++++++----------------------------------
 net/9p/trans_virtio.c  |  8 ++++----
 5 files changed, 19 insertions(+), 47 deletions(-)
---
base-commit: 21e26d5e54ab7cfe6b488fd27d4d70956d07e03b
change-id: 20230427-scan-build-d894c16fc945

Best regards,
-- 
Dominique Martinet | Asmadeus
Re: [PATCH v2 0/5] Fix scan-build warnings
Posted by Eric Van Hensbergen 2 years, 5 months ago
On Wed, 03 May 2023 16:49:24 +0900, Dominique Martinet wrote:
> I ran scan-build very crudly on our source files, and there was at least
> one real bug so we might as well run it once in a while, in which case
> we probably ought to also fix the less important things hence this
> series.
> In here the first patch is a real fix and the rest is low priority, the
> last one is arguably not an improvement and can be discussed (happy to
> just move the 0-initializations around to variable declaration which
> would also silence scan-build afaict)
> 
> [...]

Applied, thanks!

[1/5] 9p: fix ignored return value in v9fs_dir_release
      commit: eee4a119e96c2f58cfd1b6d4de42095abc5f8877
[2/5] 9p: virtio: fix unlikely null pointer deref in handle_rerror
      commit: 13ade4ac5c28e8a014fa85278f5a4270b215f906
[3/5] 9p: virtio: make sure 'offs' is initialized in zc_request
      commit: 4a73edab69d3a6623f03817fe950a2d9585f80e4
[4/5] 9p: virtio: skip incrementing unused variable
      commit: f41b402d2572e93bee85669ed05eb5e1f3725704
[5/5] 9p: remove dead stores (variable set again without being read)
      commit: cf7c33d332ab67603f159123b691c61270b14c33

Best regards,
-- 
Eric Van Hensbergen <ericvh@kernel.org>