9p: fix ignored return value in v9fs_dir_release
authorDominique Martinet <asmadeus@codewreck.org>
Wed, 3 May 2023 07:49:25 +0000 (16:49 +0900)
committerEric Van Hensbergen <ericvh@kernel.org>
Thu, 20 Jul 2023 19:05:52 +0000 (19:05 +0000)
commiteee4a119e96c2f58cfd1b6d4de42095abc5f8877
treebbd4a94079873cbb03ae65afde6eded9fb130ce2
parent350cd9b959757e7c571f45fab29d116d5f67cbff
9p: fix ignored return value in v9fs_dir_release

retval from filemap_fdatawrite was immediately overwritten by the
following p9_fid_put: preserve any error in fdatawrite if there
was any first.

This fixes the following scan-build warning:
fs/9p/vfs_dir.c:220:4: warning: Value stored to 'retval' is never read [deadcode.DeadStores]
                        retval = filemap_fdatawrite(inode->i_mapping);
                        ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fixes: 89c58cb395ec ("fs/9p: fix error reporting in v9fs_dir_release")
Cc: stable@vger.kernel.org
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Signed-off-by: Eric Van Hensbergen <ericvh@kernel.org>
fs/9p/vfs_dir.c