lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu,  6 May 2021 14:43:04 -0400
From:   Vivek Goyal <vgoyal@...hat.com>
To:     linux-fsdevel@...r.kernel.org, virtio-fs@...hat.com,
        miklos@...redi.hu
Cc:     vgoyal@...hat.com, dgilbert@...hat.com,
        linux-kernel@...r.kernel.org, dan.carpenter@...cle.com
Subject: [PATCH 2/2] virtiofs, dax: Fixed smatch warning about ret being uninitialized

Dan reported a smatch warning about "ret" being uninitialized. Fix it.

fs/fuse/dax.c:197 dmap_removemapping_list() error: uninitialized symbol 'ret'.

Reported-by: Dan Carpenter <dan.carpenter@...cle.com>
Signed-off-by: Vivek Goyal <vgoyal@...hat.com>
---
 fs/fuse/dax.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/fs/fuse/dax.c b/fs/fuse/dax.c
index f06fdad3f7b1..1608b6606ef0 100644
--- a/fs/fuse/dax.c
+++ b/fs/fuse/dax.c
@@ -253,7 +253,10 @@ static int dmap_removemapping_list(struct inode *inode, unsigned int num,
 	struct fuse_removemapping_one *remove_one, *ptr;
 	struct fuse_removemapping_in inarg;
 	struct fuse_dax_mapping *dmap;
-	int ret, i = 0, nr_alloc;
+	int ret = 0, i = 0, nr_alloc;
+
+	if (!num)
+		return ret;
 
 	nr_alloc = min_t(unsigned int, num, FUSE_REMOVEMAPPING_MAX_ENTRY);
 	remove_one = kmalloc_array(nr_alloc, sizeof(*remove_one), GFP_NOFS);
-- 
2.25.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ