Skip to content

Commit

Permalink
pnfs/flexfiles: Fix PTR_ERR() dereferences in ff_layout_track_ds_error
Browse files Browse the repository at this point in the history
mirror->mirror_ds can be NULL if uninitialised, but can contain
a PTR_ERR() if call to GETDEVICEINFO failed.

Fixes: 65990d1 ("pNFS/flexfiles: Fix a deadlock on LAYOUTGET")
Signed-off-by: Trond Myklebust <[email protected]>
Cc: [email protected] # 4.10+
  • Loading branch information
Trond Myklebust committed Jul 18, 2019
1 parent d9aba2b commit 8e04fdf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/nfs/flexfilelayout/flexfilelayoutdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8e04fdf

Please sign in to comment.