summaryrefslogtreecommitdiffstats
path: root/fs/nfs/flexfilelayout/flexfilelayoutdev.c
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@hammerspace.com>2019-07-17 19:57:44 +0200
committerTrond Myklebust <trond.myklebust@hammerspace.com>2019-07-18 20:43:52 +0200
commit8e04fdfadda75a849c649f7e50fe7d97772e1fcb (patch)
tree83b3e8539189ad81a5f756e94ae7e3f2dbc8c76a /fs/nfs/flexfilelayout/flexfilelayoutdev.c
parentNFSv4: Don't use the zero stateid with layoutget (diff)
downloadlinux-8e04fdfadda75a849c649f7e50fe7d97772e1fcb.tar.xz
linux-8e04fdfadda75a849c649f7e50fe7d97772e1fcb.zip
pnfs/flexfiles: Fix PTR_ERR() dereferences in ff_layout_track_ds_error
mirror->mirror_ds can be NULL if uninitialised, but can contain a PTR_ERR() if call to GETDEVICEINFO failed. Fixes: 65990d1afbd2 ("pNFS/flexfiles: Fix a deadlock on LAYOUTGET") Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Cc: stable@vger.kernel.org # 4.10+
Diffstat (limited to '')
-rw-r--r--fs/nfs/flexfilelayout/flexfilelayoutdev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfs/flexfilelayout/flexfilelayoutdev.c b/fs/nfs/flexfilelayout/flexfilelayoutdev.c
index 19f856f45689..3eda40a320a5 100644
--- a/fs/nfs/flexfilelayout/flexfilelayoutdev.c
+++ b/fs/nfs/flexfilelayout/flexfilelayoutdev.c
@@ -257,7 +257,7 @@ int ff_layout_track_ds_error(struct nfs4_flexfile_layout *flo,
if (status == 0)
return 0;
- if (mirror->mirror_ds == NULL)
+ if (IS_ERR_OR_NULL(mirror->mirror_ds))
return -EINVAL;
dserr = kmalloc(sizeof(*dserr), gfp_flags);