From 0c32d2a5b2a6f284efd196d568e1df3db5999c5d Mon Sep 17 00:00:00 2001 From: Viresh Kumar Date: Tue, 11 Aug 2015 07:29:19 +0530 Subject: [PATCH] greybus: svc: 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 Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/svc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/greybus/svc.c b/drivers/staging/greybus/svc.c index 7ac45a9d95c4..17ffb1353fb4 100644 --- a/drivers/staging/greybus/svc.c +++ b/drivers/staging/greybus/svc.c @@ -193,8 +193,8 @@ static int gb_svc_hello(struct gb_operation *op) * SVC sends information about the endo and interface-id on the hello * request, use that to create an endo. */ - if (op->request->payload_size != sizeof(*hello_request)) { - dev_err(dev, "%s: Illegal size of hello request (%zu %zu)\n", + if (op->request->payload_size < sizeof(*hello_request)) { + dev_err(dev, "%s: Illegal size of hello request (%zu < %zu)\n", __func__, op->request->payload_size, sizeof(*hello_request)); return -EINVAL;