aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaximilian Luz <[email protected]>2021-02-11 13:41:49 +0100
committerHans de Goede <[email protected]>2021-02-11 16:47:50 +0100
commit86eb98cb4a911631874c43309f39aa0003ad0106 (patch)
tree511b4f5821a06d1158807f594a997621da8fee3a
parente310cbf319775f46ef937c79b9cf03b73d0f8244 (diff)
platform/surface: aggregator: Fix access of unaligned value
The raw message frame length is unaligned and explicitly marked as little endian. It should not be accessed without the appropriate accessor functions. Fix this. Note that payload.len already contains the correct length after parsing via sshp_parse_frame(), so we can simply use that instead. Reported-by: kernel-test-robot <[email protected]> Fixes: c167b9c7e3d6 ("platform/surface: Add Surface Aggregator subsystem") Signed-off-by: Maximilian Luz <[email protected]> Acked-by: Mark Gross <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
-rw-r--r--drivers/platform/surface/aggregator/ssh_packet_layer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/platform/surface/aggregator/ssh_packet_layer.c b/drivers/platform/surface/aggregator/ssh_packet_layer.c
index 583315db8b02..15d96eac6811 100644
--- a/drivers/platform/surface/aggregator/ssh_packet_layer.c
+++ b/drivers/platform/surface/aggregator/ssh_packet_layer.c
@@ -1774,7 +1774,7 @@ static size_t ssh_ptl_rx_eval(struct ssh_ptl *ptl, struct ssam_span *source)
break;
}
- return aligned.ptr - source->ptr + SSH_MESSAGE_LENGTH(frame->len);
+ return aligned.ptr - source->ptr + SSH_MESSAGE_LENGTH(payload.len);
}
static int ssh_ptl_rx_threadfn(void *data)