소스 검색

gpio-button-hotplug: fix data race

bh_event_add_var can be called by multiple threads concurrently,
so it shall not use a static char buffer

Signed-off-by: Andrey Erokhin <[email protected]>
Andrey Erokhin 3 년 전
부모
커밋
1e991e09b7
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c

+ 1 - 1
package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c

@@ -107,7 +107,7 @@ static struct bh_map button_map[] = {
 static __printf(3, 4)
 int bh_event_add_var(struct bh_event *event, int argv, const char *format, ...)
 {
-	static char buf[128];
+	char buf[128];
 	char *s;
 	va_list args;
 	int len;