Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f1f6fa44 authored by Viresh Kumar's avatar Viresh Kumar Committed by Greg Kroah-Hartman
Browse files

greybus: sdio: error out only for smaller payloads received



!= was used in place of <, while comparing expected and actual payload
size. The module may be running a higher version of the protocol and
might have some extra fields (towards the end) in the structure, and the
AP needs to ignore them.

This also updates the print (expected-payload-size <
actual-payload-size), when the size doesn't match for requests received
by the module. This gives more details required for debugging.

Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 782c3b73
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -192,8 +192,9 @@ static int gb_sdio_event_recv(u8 type, struct gb_operation *op)

	request = op->request;

	if (request->payload_size != sizeof(*payload)) {
		dev_err(mmc_dev(host->mmc), "wrong event size received\n");
	if (request->payload_size < sizeof(*payload)) {
		dev_err(mmc_dev(host->mmc), "wrong event size received (%zu < %zu)\n",
			request->payload_size, sizeof(*payload));
		return -EINVAL;
	}