diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 904e08bbb28929fd1e0bdeafa12bc741a97c9514..31ae3bd5d9d208e44509ebf4ad549d543ee10a7c 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -3133,7 +3133,7 @@ static int _nfs4_do_setattr(struct inode *inode, if (nfs4_copy_delegation_stateid(inode, FMODE_WRITE, &arg->stateid, &delegation_cred)) { /* Use that stateid */ - } else if (ctx != NULL) { + } else if (ctx != NULL && ctx->state) { struct nfs_lock_context *l_ctx; if (!nfs4_valid_open_stateid(ctx->state)) return -EBADF;