From 7e65624d32b6e0429b1d3559e5585657f34f74a1 Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Wed, 9 Jun 2021 14:09:52 -0400 Subject: ceph: allow ceph_put_mds_session to take NULL or ERR_PTR ...to simplify some error paths. Signed-off-by: Jeff Layton Reviewed-by: Luis Henriques Signed-off-by: Ilya Dryomov --- fs/ceph/dir.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'fs/ceph/dir.c') diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c index 9ba79b6531fb..973489dafe91 100644 --- a/fs/ceph/dir.c +++ b/fs/ceph/dir.c @@ -1809,8 +1809,7 @@ static void ceph_d_release(struct dentry *dentry) dentry->d_fsdata = NULL; spin_unlock(&dentry->d_lock); - if (di->lease_session) - ceph_put_mds_session(di->lease_session); + ceph_put_mds_session(di->lease_session); kmem_cache_free(ceph_dentry_cachep, di); } -- cgit