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 <a.erokhin@inango-systems.com>
(cherry picked from commit 1e991e09b73c309321d21b9cb706bd5139d952d2)
This commit is contained in:
Andrey Erokhin 2022-04-06 12:36:15 +03:00 committed by Daniel Golle
parent 0db5044f51
commit 8f4124c252

View File

@ -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;