Browse Source

greybus: operation: fix broken response tracepoint

The response-received tracepoint is currently broken. Instead of parsing
the received message header it was tracing a bunch of zeroed fields from
an uninitialised response buffer.

Fix this by moving the tracepoint after were the response buffer is
initialised.

Fixes: 7cb496e6890e ("greybus: tracing: fix message traces")
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Johan Hovold 9 years ago
parent
commit
112f563e18
1 changed files with 3 additions and 1 deletions
  1. 3 1
      drivers/staging/greybus/operation.c

+ 3 - 1
drivers/staging/greybus/operation.c

@@ -974,7 +974,6 @@ static void gb_connection_recv_response(struct gb_connection *connection,
 			errno = -EMSGSIZE;
 			errno = -EMSGSIZE;
 		}
 		}
 	}
 	}
-	trace_gb_message_recv_response(operation->response);
 
 
 	/* We must ignore the payload if a bad status is returned */
 	/* We must ignore the payload if a bad status is returned */
 	if (errno)
 	if (errno)
@@ -983,6 +982,9 @@ static void gb_connection_recv_response(struct gb_connection *connection,
 	/* The rest will be handled in work queue context */
 	/* The rest will be handled in work queue context */
 	if (gb_operation_result_set(operation, errno)) {
 	if (gb_operation_result_set(operation, errno)) {
 		memcpy(message->buffer, data, size);
 		memcpy(message->buffer, data, size);
+
+		trace_gb_message_recv_response(message);
+
 		queue_work(gb_operation_completion_wq, &operation->work);
 		queue_work(gb_operation_completion_wq, &operation->work);
 	}
 	}