From: Andrey Erokhin Date: Wed, 6 Apr 2022 09:36:15 +0000 (+0300) Subject: gpio-button-hotplug: fix data race X-Git-Tag: v22.03.0-rc1~62 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8f4124c2521c30a79270163c8d6c4ccda336fb8e;p=thirdparty%2Fopenwrt.git 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 (cherry picked from commit 1e991e09b73c309321d21b9cb706bd5139d952d2) --- diff --git a/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c b/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c index fcaf7f59de5..2b39ec8f3be 100644 --- a/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c +++ b/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;