Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged

Conversation

HongChao6
Copy link
Contributor

Buffer nums is not multiplied by the structure size

Summary

Impact

Testing

Buffer nums is not multiplied by the structure size

Signed-off-by: liuhongchao <liuhongchao@xiaomi.com>
@@ -123,7 +123,8 @@ static int keyboard_open(FAR struct file *filep)

/* 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));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

circbuf still needs to be released in failure case

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HongChao6 please create a new patch fix the leak at line 142.

@xiaoxiang781216 xiaoxiang781216 merged commit 7dde402 into apache:master Aug 11, 2023
26 checks passed
@jerpelea jerpelea added this to To-Add in Release Notes - 12.3.0 Sep 26, 2023
@jerpelea jerpelea moved this from To-Add to drivers in Release Notes - 12.3.0 Sep 27, 2023
@jerpelea jerpelea moved this from drivers to done in Release Notes - 12.3.0 Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants