diff mbox series

[v2,08/18] ceph: fix decode_locker to use ceph_decode_entity_addr

Message ID 20190617153753.3611-9-jlayton@kernel.org (mailing list archive)
State New, archived
Headers show
Series ceph: addr2, btime and change_attr support | expand

Commit Message

Jeff Layton June 17, 2019, 3:37 p.m. UTC
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 net/ceph/cls_lock_client.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/net/ceph/cls_lock_client.c b/net/ceph/cls_lock_client.c
index 4cc28541281b..b1d12bf4b83e 100644
--- a/net/ceph/cls_lock_client.c
+++ b/net/ceph/cls_lock_client.c
@@ -264,8 +264,11 @@  static int decode_locker(void **p, void *end, struct ceph_locker *locker)
 		return ret;
 
 	*p += sizeof(struct ceph_timespec); /* skip expiration */
-	ceph_decode_copy(p, &locker->info.addr, sizeof(locker->info.addr));
-	ceph_decode_addr(&locker->info.addr);
+
+	ret = ceph_decode_entity_addr(p, end, &locker->info.addr);
+	if (ret)
+		return ret;
+
 	len = ceph_decode_32(p);
 	*p += len; /* skip description */