greybus: raw: Print expected/actual payload size on mismatch

This change “greybus: raw: Print expected/actual payload size on mismatch” in Linux kernel is authored by Viresh Kumar <viresh.kumar [at] linaro.org> on Thu Aug 6 12:44:52 2015 +0530.

greybus: raw: Print expected/actual payload size on mismatch

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 the issue.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>

This Linux change may have been applied to various maintained Linux releases and you can find Linux releases including commit 7fea641.

There are 3 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/staging/greybus/raw.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/greybus/raw.c b/drivers/staging/greybus/raw.c
index 3be96db..a17a986 100644
--- a/drivers/staging/greybus/raw.c
+++ b/drivers/staging/greybus/raw.c
@@ -121,7 +121,8 @@ static int gb_raw_receive(u8 type, struct gb_operation *op)
 
 	/* Verify size of payload */
 	if (op->request->payload_size < sizeof(*receive)) {
-		dev_err(raw->device, "raw receive request too smalln");
+		dev_err(raw->device, "raw receive request too small (%zu < %zu)n",
+			op->request->payload_size, sizeof(*receive));
 		return -EINVAL;
 	}
 	receive = op->request->payload;

The commit for this change in Linux stable tree is 7fea641 (patch).

Leave a Reply

Your email address will not be published. Required fields are marked *