summaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4xdr.c
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2015-01-24 01:04:44 +0100
committerTrond Myklebust <trond.myklebust@primarydata.com>2015-01-24 05:06:45 +0100
commita67964197c946adbb14d91c3d878af22de47091c (patch)
tree8996c288bf2614957663ed1fa83d782ef5fe8ea7 /fs/nfs/nfs4xdr.c
parentNFSv4: Convert nfs_alloc_seqid() to return an ERR_PTR() if allocation fails (diff)
downloadlinux-a67964197c946adbb14d91c3d878af22de47091c.tar.xz
linux-a67964197c946adbb14d91c3d878af22de47091c.zip
NFSv4: Check for NULL argument in nfs_*_seqid() functions
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/nfs4xdr.c')
-rw-r--r--fs/nfs/nfs4xdr.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 7e7be5ab70bb..d05fada4929c 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -946,7 +946,10 @@ static void encode_uint64(struct xdr_stream *xdr, u64 n)
static void encode_nfs4_seqid(struct xdr_stream *xdr,
const struct nfs_seqid *seqid)
{
- encode_uint32(xdr, seqid->sequence->counter);
+ if (seqid != NULL)
+ encode_uint32(xdr, seqid->sequence->counter);
+ else
+ encode_uint32(xdr, 0);
}
static void encode_compound_hdr(struct xdr_stream *xdr,