]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commit
ceph: fix an oops in error handling in ceph_netfs_issue_op
authorJeff Layton <jlayton@kernel.org>
Tue, 2 Feb 2021 13:10:41 +0000 (08:10 -0500)
committerDavid Howells <dhowells@redhat.com>
Tue, 2 Feb 2021 18:48:06 +0000 (18:48 +0000)
commitb9425ace19e579e19e49a58d7f483a8a48d311c7
tree53ebbacadadd35546e68c68263eb47a5b04ba85a
parentd40a904c12113e6843de4b44aceef8674c0d7daa
ceph: fix an oops in error handling in ceph_netfs_issue_op

Dan reported a potential oops in the cleanup if ceph_osdc_new_request
returns an error. Eliminate the unneeded initialization of "req" and
then just set it to NULL in the case where it holds an ERR_PTR.

Also, drop the unneeded NULL check before calling
ceph_osdc_put_request.

Fixes: 1cf7fdf52d5a ("ceph: convert readpage to fscache read helper")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Suggested-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
fs/ceph/addr.c