Drivers: hv: allocate the exact needed memory for messages
authorVitaly Kuznetsov <vkuznets@redhat.com>
Mon, 6 Apr 2020 10:41:51 +0000 (12:41 +0200)
committerWei Liu <wei.liu@kernel.org>
Thu, 23 Apr 2020 13:17:10 +0000 (13:17 +0000)
commita276463b7aeb6186e7e4315cccb032773fb31b5d
tree146a66a72e15b62f8f48a6c71fb8f62ca2c50521
parentac0f7d42584125dab8039e60ab4ade48cc2db61c
Drivers: hv: allocate the exact needed memory for messages

When we need to pass a buffer with Hyper-V message we don't need to always
allocate 256 bytes for the message: the real message length is known from
the header. Change 'struct onmessage_work_context' to make it possible to
not over-allocate.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Link: https://lore.kernel.org/r/20200406104154.45010-3-vkuznets@redhat.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
drivers/hv/vmbus_drv.c