projects
/
platform
/
upstream
/
bluez.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9145b36
)
avctp: Fix EINVAL on uinput creation
author
Haochen Tong
<i@hexchain.org>
Sun, 12 Jan 2020 00:42:26 +0000
(
01:42
+0100)
committer
Ayush Garg
<ayush.garg@samsung.com>
Mon, 12 Apr 2021 09:00:48 +0000
(14:30 +0530)
The struct uinput_dev variable is on stack, so clear its content to
avoid accidentally writing garbage values to kernel. This fixes "Can't
create uinput device: Invalid argument (22)" in some cases.
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
profiles/audio/avctp.c
patch
|
blob
|
history
diff --git
a/profiles/audio/avctp.c
b/profiles/audio/avctp.c
index
66a4d93
..
8b731e7
100644
(file)
--- a/
profiles/audio/avctp.c
+++ b/
profiles/audio/avctp.c
@@
-1240,6
+1240,8
@@
static int uinput_create(struct btd_device *device, const char *name,
}
}
+ memset(&dev, 0, sizeof(dev));
+
if (name) {
strncpy(dev.name, name, UINPUT_MAX_NAME_SIZE);
dev.name[UINPUT_MAX_NAME_SIZE - 1] = '\0';