aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rpmsg
diff options
context:
space:
mode:
authorOhad Ben-Cohen <ohad@wizery.com>2012-02-28 09:11:28 -0500
committerOhad Ben-Cohen <ohad@wizery.com>2012-02-28 12:10:04 -0500
commitf1d9e9c767f96f57a3cca5304c046f692e115ec9 (patch)
treea7cd3cc58dade02f00961b0bb68136b7037e30cb /drivers/rpmsg
parent9648224e564aa0d6e3a803bd0e056802cc97297c (diff)
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 <ohad@wizery.com> Cc: Grant Likely <grant.likely@secretlab.ca> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Mark Grosen <mgrosen@ti.com> Cc: Suman Anna <s-anna@ti.com> Cc: Fernando Guzman Lugo <fernando.lugo@ti.com> Cc: Rob Clark <rob@ti.com> Cc: Ludovic BARRE <ludovic.barre@stericsson.com> Cc: Loic PALLARDY <loic.pallardy@stericsson.com> Cc: Omar Ramirez Luna <omar.luna@linaro.org>
Diffstat (limited to 'drivers/rpmsg')
-rw-r--r--drivers/rpmsg/virtio_rpmsg_bus.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c
index 1e8b8b618674..f93ca3b8fd42 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)
798 else 798 else
799 dev_warn(dev, "msg received with no recepient\n"); 799 dev_warn(dev, "msg received with no recepient\n");
800 800
801 sg_init_one(&sg, msg, sizeof(*msg) + len); 801 /* publish the real size of the buffer */
802 sg_init_one(&sg, msg, RPMSG_BUF_SIZE);
802 803
803 /* add the buffer back to the remote processor's virtqueue */ 804 /* add the buffer back to the remote processor's virtqueue */
804 err = virtqueue_add_buf(vrp->rvq, &sg, 0, 1, msg, GFP_KERNEL); 805 err = virtqueue_add_buf(vrp->rvq, &sg, 0, 1, msg, GFP_KERNEL);