diff options
author | Jeff Layton <jlayton@kernel.org> | 2023-01-06 18:33:47 +0300 |
---|---|---|
committer | Chuck Lever <chuck.lever@oracle.com> | 2023-02-20 17:20:21 +0300 |
commit | 70f62231cdfd52357836733dd31db787e0412ab2 (patch) | |
tree | 3195f34c1dcd607aed17b4720af32f51c8ae7753 /fs/nfsd/nfs4state.c | |
parent | df24ac7a2e3a9d0bc68f1756a880e50bfe4b4522 (diff) | |
download | linux-70f62231cdfd52357836733dd31db787e0412ab2.tar.xz |
nfsd: allow nfsd_file_get to sanely handle a NULL pointer
...and remove some now-useless NULL pointer checks in its callers.
Suggested-by: NeilBrown <neilb@suse.de>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs/nfsd/nfs4state.c')
-rw-r--r-- | fs/nfsd/nfs4state.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index c69f27d3adb7..9657dab980cb 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -602,9 +602,7 @@ put_nfs4_file(struct nfs4_file *fi) static struct nfsd_file * __nfs4_get_fd(struct nfs4_file *f, int oflag) { - if (f->fi_fds[oflag]) - return nfsd_file_get(f->fi_fds[oflag]); - return NULL; + return nfsd_file_get(f->fi_fds[oflag]); } static struct nfsd_file * |