summaryrefslogtreecommitdiff
path: root/fs/ceph
diff options
context:
space:
mode:
authorViacheslav Dubeyko <Slava.Dubeyko@ibm.com>2025-06-06 22:04:32 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-11-24 12:29:49 +0300
commit34353a0cd39bdda2fc6ea4b575d2a1770034097a (patch)
treeea5e4df823dcb2e8a8e030f3f7466fc8d3b504e5 /fs/ceph
parent068e002bc0b6e3847fdda65ee9e1c876c65e89a9 (diff)
downloadlinux-34353a0cd39bdda2fc6ea4b575d2a1770034097a.tar.xz
ceph: add checking of wait_for_completion_killable() return value
[ Upstream commit b7ed1e29cfe773d648ca09895b92856bd3a2092d ] The Coverity Scan service has detected the calling of wait_for_completion_killable() without checking the return value in ceph_lock_wait_for_completion() [1]. The CID 1636232 defect contains explanation: "If the function returns an error value, the error value may be mistaken for a normal value. In ceph_lock_wait_for_completion(): Value returned from a function is not checked for errors before being used. (CWE-252)". The patch adds the checking of wait_for_completion_killable() return value and return the error code from ceph_lock_wait_for_completion(). [1] https://scan5.scan.coverity.com/#/project-view/64304/10063?selectedIssue=1636232 Signed-off-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com> Reviewed-by: Alex Markuze <amarkuze@redhat.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs/ceph')
-rw-r--r--fs/ceph/locks.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/ceph/locks.c b/fs/ceph/locks.c
index cb51c7e9c8e2..02f5fbe83aa4 100644
--- a/fs/ceph/locks.c
+++ b/fs/ceph/locks.c
@@ -219,7 +219,10 @@ static int ceph_lock_wait_for_completion(struct ceph_mds_client *mdsc,
if (err && err != -ERESTARTSYS)
return err;
- wait_for_completion_killable(&req->r_safe_completion);
+ err = wait_for_completion_killable(&req->r_safe_completion);
+ if (err)
+ return err;
+
return 0;
}