git: bbed4b41c9f1 - main - hidmap: Do not forget to initialize bitmap items to unset state

Vladimir Kondratyev wulf at FreeBSD.org
Thu Sep 2 19:36:00 UTC 2021


The branch main has been updated by wulf:

URL: https://cgit.FreeBSD.org/src/commit/?id=bbed4b41c9f193996f704b3262126e59810b30c9

commit bbed4b41c9f193996f704b3262126e59810b30c9
Author:     Vladimir Kondratyev <wulf at FreeBSD.org>
AuthorDate: 2021-09-02 19:32:14 +0000
Commit:     Vladimir Kondratyev <wulf at FreeBSD.org>
CommitDate: 2021-09-02 19:35:27 +0000

    hidmap: Do not forget to initialize bitmap items to unset state
    
    MFC after:      2 week
---
 sys/dev/hid/hidmap.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sys/dev/hid/hidmap.c b/sys/dev/hid/hidmap.c
index c46930214323..d787b298b41d 100644
--- a/sys/dev/hid/hidmap.c
+++ b/sys/dev/hid/hidmap.c
@@ -451,7 +451,8 @@ hidmap_probe_hid_descr(void *d_ptr, hid_size_t d_len, uint8_t tlc_index,
 	bool do_free = false;
 
 	if (caps == NULL) {
-		caps = malloc(HIDMAP_CAPS_SZ(nitems_map), M_DEVBUF, M_WAITOK);
+		caps = malloc(HIDMAP_CAPS_SZ(nitems_map), M_DEVBUF,
+		    M_WAITOK | M_ZERO);
 		do_free = true;
 	} else
 		bzero (caps, HIDMAP_CAPS_SZ(nitems_map));


More information about the dev-commits-src-main mailing list