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
| ||
|
Message-Id: <20230128152549.1241870-1-trix@redhat.com> Date: Sat, 28 Jan 2023 07:25:49 -0800 From: Tom Rix <trix@...hat.com> To: ericvh@...il.com, lucho@...kov.net, asmadeus@...ewreck.org, linux_oss@...debyte.com Cc: v9fs-developer@...ts.sourceforge.net, linux-kernel@...r.kernel.org, Tom Rix <trix@...hat.com> Subject: [PATCH] 9p: remove shadow variable retval in v9fs_dir_release() cppcheck reports fs/9p/vfs_dir.c:219:8: style: Local variable 'retval' shadows outer variable [shadowVariable] int retval = file_write_and_wait_range(filp, 0, -1); ^ Having another retval decl is not needed, if the initialized 0 is overwritten by a non 0 value by the call to file_write_and_wait_ranget(), the function returns early. Fixes: b67c64fb0143 ("fs/9p: Consolidate file operations and add readahead and writeback") Signed-off-by: Tom Rix <trix@...hat.com> --- fs/9p/vfs_dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/9p/vfs_dir.c b/fs/9p/vfs_dir.c index 1fc07bb86e6f..a5783afdf31a 100644 --- a/fs/9p/vfs_dir.c +++ b/fs/9p/vfs_dir.c @@ -216,7 +216,7 @@ int v9fs_dir_release(struct inode *inode, struct file *filp) inode, filp, fid ? fid->fid : -1); if (fid) { if ((fid->qid.type == P9_QTFILE) && (filp->f_mode & FMODE_WRITE)) { - int retval = file_write_and_wait_range(filp, 0, -1); + retval = file_write_and_wait_range(filp, 0, -1); if (retval != 0) { p9_debug(P9_DEBUG_ERROR, -- 2.26.3
Powered by blists - more mailing lists