svcxdr_encode_owner needs to handle case where no lock owner info to pass back, obj->len == 0. Fixes: a6a63ca5652e ("lockd: Common NLM XDR helpers") Signed-off-by: Dai Ngo <dai.ngo@xxxxxxxxxx> --- fs/lockd/svcxdr.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/lockd/svcxdr.h b/fs/lockd/svcxdr.h index c69a0bb76c94..04fde20ea8c1 100644 --- a/fs/lockd/svcxdr.h +++ b/fs/lockd/svcxdr.h @@ -139,6 +139,8 @@ svcxdr_encode_owner(struct xdr_stream *xdr, const struct xdr_netobj *obj) if (xdr_stream_encode_u32(xdr, obj->len) < 0) return false; + if (obj->len == 0) + return true; p = xdr_reserve_space(xdr, obj->len); if (!p) return false; -- 2.9.5