drivers/input:Fix setting the number of keyboard driver buffers fails

Buffer nums is not multiplied by the structure size

Signed-off-by: liuhongchao <liuhongchao@xiaomi.com>
This commit is contained in:
liuhongchao 2023-07-05 14:31:21 +08:00 committed by Xiang Xiao
parent a69b6846e6
commit 7dde402982

View File

@ -123,7 +123,8 @@ static int keyboard_open(FAR struct file *filep)
/* Initializes the buffer for each open file */ /* Initializes the buffer for each open file */
ret = circbuf_init(&opriv->circ, NULL, upper->nums); ret = circbuf_init(&opriv->circ, NULL,
upper->nums * sizeof(struct keyboard_event_s));
if (ret < 0) if (ret < 0)
{ {
kmm_free(opriv); kmm_free(opriv);