git: 116adffd0f6a - stable/13 - hidmap: Do not forget to initialize bitmap items to unset state

Vladimir Kondratyev wulf at FreeBSD.org
Tue Sep 21 23:43:46 UTC 2021


The branch stable/13 has been updated by wulf:

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

commit 116adffd0f6ae5c33cab921a338152e01f2ced5a
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-21 23:40:37 +0000

    hidmap: Do not forget to initialize bitmap items to unset state
    
    (cherry picked from commit bbed4b41c9f193996f704b3262126e59810b30c9)
---
 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-all mailing list