diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 809080ad3ad49c6009b7f00e1ddb6604de6d4bd2..6fb73f66251ba7a1dcea7297869ae112beb2151a 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -3124,7 +3124,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;