From: Matt Porter Date: Mon, 22 Sep 2014 19:51:49 +0000 (-0400) Subject: greybus: initialize all fields in an SVC handshake message X-Git-Tag: v4.9-rc1~119^2~378^2~21^2~2092 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=be5064c75bb9e513698142584f4bb64de73e9f18;p=karo-tx-linux.git greybus: initialize all fields in an SVC handshake message Currently only the handshake_type is being initialized when responding to an SVC handshake request. Update this to explicitly set all header/payload fields appropriately. Signed-off-by: Matt Porter Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/ap.c b/drivers/staging/greybus/ap.c index 21f2e3327f12..78e9e4a1db2e 100644 --- a/drivers/staging/greybus/ap.c +++ b/drivers/staging/greybus/ap.c @@ -93,6 +93,12 @@ static void svc_handshake(struct svc_function_handshake *handshake, if (!svc_msg) return; + svc_msg->header.function_id = SVC_FUNCTION_HANDSHAKE; + svc_msg->header.message_type = SVC_MSG_DATA; + svc_msg->header.payload_length = + cpu_to_le16(sizeof(struct svc_function_handshake)); + svc_msg->handshake.version_major = GREYBUS_VERSION_MAJOR; + svc_msg->handshake.version_minor = GREYBUS_VERSION_MINOR; svc_msg->handshake.handshake_type = SVC_HANDSHAKE_AP_HELLO; svc_msg_send(svc_msg, hd); }