From c296cfe26bdd86de6eeefde57d333174ed9574d0 Mon Sep 17 00:00:00 2001 From: Fred Isaman Date: Tue, 2 May 2017 16:53:36 -0400 Subject: pNFS: Fix NULL dereference in pnfs_generic_alloc_ds_commits Signed-off-by: Fred Isaman Signed-off-by: Trond Myklebust --- fs/nfs/pnfs_nfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/nfs') diff --git a/fs/nfs/pnfs_nfs.c b/fs/nfs/pnfs_nfs.c index ae600ab1a646..d40755a0984b 100644 --- a/fs/nfs/pnfs_nfs.c +++ b/fs/nfs/pnfs_nfs.c @@ -221,7 +221,7 @@ pnfs_generic_alloc_ds_commits(struct nfs_commit_info *cinfo, * If the layout segment is invalid, then let * pnfs_generic_retry_commit() clean up the bucket. */ - if (!pnfs_is_valid_lseg(bucket->clseg) && + if (bucket->clseg && !pnfs_is_valid_lseg(bucket->clseg) && !test_bit(NFS_LSEG_LAYOUTRETURN, &bucket->clseg->pls_flags)) break; data = nfs_commitdata_alloc(false); -- cgit v1.2.3