You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "HongChao6 (via GitHub)" <gi...@apache.org> on 2023/08/11 01:45:51 UTC

[GitHub] [nuttx] HongChao6 opened a new pull request, #10163: drivers/input:Fix setting the number of keyboard driver buffers fails

HongChao6 opened a new pull request, #10163:
URL: https://github.com/apache/nuttx/pull/10163

   Buffer nums is not multiplied by the structure size
   
   ## Summary
   
   ## Impact
   
   ## Testing
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #10163: drivers/input:Fix setting the number of keyboard driver buffers fails

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #10163:
URL: https://github.com/apache/nuttx/pull/10163#discussion_r1290903113


##########
drivers/input/keyboard_upper.c:
##########
@@ -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));

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



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx] anchao commented on a diff in pull request #10163: drivers/input:Fix setting the number of keyboard driver buffers fails

Posted by "anchao (via GitHub)" <gi...@apache.org>.
anchao commented on code in PR #10163:
URL: https://github.com/apache/nuttx/pull/10163#discussion_r1290865713


##########
drivers/input/keyboard_upper.c:
##########
@@ -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));

Review Comment:
   circbuf still needs to be released in failure case



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx] xiaoxiang781216 merged pull request #10163: drivers/input:Fix setting the number of keyboard driver buffers fails

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 merged PR #10163:
URL: https://github.com/apache/nuttx/pull/10163


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org