diff options
author | Andrey Erokhin <a.erokhin@inango-systems.com> | 2022-04-06 12:36:15 +0300 |
---|---|---|
committer | Daniel Golle <daniel@makrotopia.org> | 2022-04-10 16:26:01 +0100 |
commit | 8f4124c2521c30a79270163c8d6c4ccda336fb8e (patch) | |
tree | cc7f6962e9bb450ff08461e93092014b8e3c8ec0 | |
parent | 0db5044f511650bb00a397de1cc63d7f4883a2f5 (diff) | |
download | upstream-8f4124c2521c30a79270163c8d6c4ccda336fb8e.tar.gz upstream-8f4124c2521c30a79270163c8d6c4ccda336fb8e.tar.bz2 upstream-8f4124c2521c30a79270163c8d6c4ccda336fb8e.zip |
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)
-rw-r--r-- | package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c | 2 |
1 files changed, 1 insertions, 1 deletions
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 fcaf7f59de..2b39ec8f3b 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; |