Commit 86eb98cb authored by Maximilian Luz's avatar Maximilian Luz Committed by Hans de Goede

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: default avatarkernel-test-robot <lkp@intel.com>
Fixes: c167b9c7 ("platform/surface: Add Surface Aggregator subsystem")
Signed-off-by: default avatarMaximilian Luz <luzmaximilian@gmail.com>
Acked-by: default avatarMark Gross <mgross@linux.intel.com>
Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20210211124149.2439007-1-luzmaximilian@gmail.comSigned-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent e310cbf3
...@@ -1774,7 +1774,7 @@ static size_t ssh_ptl_rx_eval(struct ssh_ptl *ptl, struct ssam_span *source) ...@@ -1774,7 +1774,7 @@ static size_t ssh_ptl_rx_eval(struct ssh_ptl *ptl, struct ssam_span *source)
break; 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) static int ssh_ptl_rx_threadfn(void *data)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment