diff options
author | Trond Myklebust <trond.myklebust@hammerspace.com> | 2019-07-17 13:57:44 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-07-26 09:14:22 +0200 |
commit | 603e7497bf275ef3766bb55323a23235dc0f0dfa (patch) | |
tree | 09a70b7a18a830e9b314e4f77106c1e2398d7616 | |
parent | 5347e61954fcf2e47cbe9620aa21e42f4bc94057 (diff) | |
download | linux-stable-603e7497bf275ef3766bb55323a23235dc0f0dfa.tar.gz linux-stable-603e7497bf275ef3766bb55323a23235dc0f0dfa.tar.bz2 linux-stable-603e7497bf275ef3766bb55323a23235dc0f0dfa.zip |
pnfs/flexfiles: Fix PTR_ERR() dereferences in ff_layout_track_ds_error
commit 8e04fdfadda75a849c649f7e50fe7d97772e1fcb upstream.
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+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | fs/nfs/flexfilelayout/flexfilelayoutdev.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfs/flexfilelayout/flexfilelayoutdev.c b/fs/nfs/flexfilelayout/flexfilelayoutdev.c index 364028c710a8..8da239b6cc16 100644 --- a/fs/nfs/flexfilelayout/flexfilelayoutdev.c +++ b/fs/nfs/flexfilelayout/flexfilelayoutdev.c @@ -307,7 +307,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); |