mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:14:22 +08:00
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:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user