summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/sdio.c
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2015-08-08 08:09:32 +0530
committerGreg Kroah-Hartman <gregkh@google.com>2015-08-10 17:36:55 -0700
commitf1f6fa44ae49e91c0a5fe9e0c6e5614e6aa22283 (patch)
treed56c5b3dbdfefa8a1bceb6fbb043b547668ad11b /drivers/staging/greybus/sdio.c
parent782c3b732889b5fbce796a4b548d47a43e4d8c42 (diff)
downloadlinux-f1f6fa44ae49e91c0a5fe9e0c6e5614e6aa22283.tar.bz2
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: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/sdio.c')
-rw-r--r--drivers/staging/greybus/sdio.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/staging/greybus/sdio.c b/drivers/staging/greybus/sdio.c
index a709bd64f824..345cffff7db0 100644
--- a/drivers/staging/greybus/sdio.c
+++ b/drivers/staging/greybus/sdio.c
@@ -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;
}