From: Fred Isaman Date: Tue, 2 May 2017 20:53:36 +0000 (-0400) Subject: pNFS: Fix NULL dereference in pnfs_generic_alloc_ds_commits X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c296cfe26bdd86de6eeefde57d333174ed9574d0;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git pNFS: Fix NULL dereference in pnfs_generic_alloc_ds_commits Signed-off-by: Fred Isaman Signed-off-by: Trond Myklebust --- 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);