platform: msm_shared: Do not return pointer allocated on stack

RPM response is read into local buffer which is allocated
on stack and returned to the caller. Returning pointer on stack
will have undefined behaviour, pass response buffer from the caller
to avoid this problem.

Change-Id: Iac967725659166fb6100a02fbac68041ce8cb7af
diff --git a/platform/msm_shared/rpm-smd.c b/platform/msm_shared/rpm-smd.c
index d623542..0756bcd 100644
--- a/platform/msm_shared/rpm-smd.c
+++ b/platform/msm_shared/rpm-smd.c
@@ -133,8 +133,12 @@
 	rpm_ack_msg *resp;
 	msg_type type;
 	uint32_t ret = 0;
+	/* As per the current design rpm response does not exceed 20 bytes */
+	uint32_t response[5];
 
-	resp = (rpm_ack_msg*)smd_read(&ch, len, SMD_APPS_RPM);
+	smd_read(&ch, len, SMD_APPS_RPM, response);
+
+	resp = (rpm_ack_msg *)response;
 
 	arch_invalidate_cache_range((addr_t)resp, sizeof(rpm_gen_hdr));