Forráskód Böngészése

msm: adsprpc: Use memcpy for trace events in LE

LE static analysis KW is giving error from fastrpc traces because
traces are using __assign_str() which translates to strcpy() and
this is a deprecated API.
Kernel team suggested to use memcpy instead of __assign_str().

Change-Id: Idf92446a26d8b6f472963e9215f738df3f6fcdef
Edgar Flores 2 éve
szülő
commit
cb7a1b4f73
1 módosított fájl, 5 hozzáadás és 0 törlés
  1. 5 0
      dsp/fastrpc_trace.h

+ 5 - 0
dsp/fastrpc_trace.h

@@ -381,7 +381,12 @@ TRACE_EVENT(fastrpc_msg,
 	TP_ARGS(message),
 	TP_STRUCT__entry(__string(buf, message)),
 	TP_fast_assign(
+#if IS_ENABLED(CONFIG_MSM_ADSPRPC_TRUSTED)
+		memcpy(__get_str(buf), (message), (sizeof(message) - 1));
+		__get_str(buf)[sizeof(message) - 1] = '\0';
+#else
 		__assign_str(buf, message);
+#endif
 	),
 	TP_printk(" %s", __get_str(buf))
 );