From f1d9e9c767f96f57a3cca5304c046f692e115ec9 Mon Sep 17 00:00:00 2001 From: Ohad Ben-Cohen Date: Tue, 28 Feb 2012 16:11:28 +0200 Subject: rpmsg: fix published buffer length in rpmsg_recv_done After processing an incoming message, always publish the real size of its containing buffer when putting it back on the available rx ring. Using any different value might erroneously limit the remote processor (leading it to think the buffer is smaller than it really is). Signed-off-by: Ohad Ben-Cohen Cc: Grant Likely Cc: Arnd Bergmann Cc: Mark Grosen Cc: Suman Anna Cc: Fernando Guzman Lugo Cc: Rob Clark Cc: Ludovic BARRE Cc: Loic PALLARDY Cc: Omar Ramirez Luna --- drivers/rpmsg/virtio_rpmsg_bus.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/rpmsg') diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c index 1e8b8b61867..f93ca3b8fd4 100644 --- a/drivers/rpmsg/virtio_rpmsg_bus.c +++ b/drivers/rpmsg/virtio_rpmsg_bus.c @@ -798,7 +798,8 @@ static void rpmsg_recv_done(struct virtqueue *rvq) else dev_warn(dev, "msg received with no recepient\n"); - sg_init_one(&sg, msg, sizeof(*msg) + len); + /* publish the real size of the buffer */ + sg_init_one(&sg, msg, RPMSG_BUF_SIZE); /* add the buffer back to the remote processor's virtqueue */ err = virtqueue_add_buf(vrp->rvq, &sg, 0, 1, msg, GFP_KERNEL); -- cgit v1.2.3-70-g09d2