Skip to content

Conversation

@ActoryOu
Copy link
Member

Fix memset in USBDDriver_Initialize

Description

As #1103 described, the memset usage is incorrect.

Test Steps

Checklist:

  • I have tested my changes. No regression in existing tests.
  • I have modified and/or added unit-tests to cover the code changes in this Pull Request.

Related Issue

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@ActoryOu ActoryOu requested a review from a team as a code owner October 19, 2023 09:43
if (pInterfaces != 0) {

memset(pInterfaces, sizeof(pInterfaces), 0);
memset(pInterfaces, 0, sizeof(uint8_t));
Copy link
Member

Choose a reason for hiding this comment

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

What is the purpose of this statement I wonder.
Because this is not setting the whole array to 0, it is just setting the first element to 0. Does that mean that we are using entry with a 0 as a delimiter?

Just trying to understand why is this being done at all :)

Copy link
Member Author

Choose a reason for hiding this comment

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

IMHO, "multiple USB driver" is not supported in this version. I believe this is for future use. Confirming with partner but no response yet.

if (pInterfaces != 0) {

memset(pInterfaces, sizeof(pInterfaces), 0);
memset(pInterfaces, 0, sizeof(uint8_t));
Copy link
Member

Choose a reason for hiding this comment

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

Same here. I ask because I am not that familiar with the USB driver code.

@ActoryOu ActoryOu marked this pull request as draft November 21, 2023 01:46
@ActoryOu
Copy link
Member Author

ActoryOu commented Nov 21, 2023

Since this file is not maintained by us, I'm trying to contact partner to address this.

@ActoryOu
Copy link
Member Author

ActoryOu commented Dec 4, 2023

Close this issue for now because this file is not maintained by us.
This is a patch for correcting usage of memset, and it's harmless even it's incorrectly used with length 0.

Thank you.

@ActoryOu ActoryOu closed this Dec 4, 2023
@ActoryOu ActoryOu deleted the SAMA5DxxMemset branch December 4, 2023 03:37
every-breaking-wave pushed a commit to every-breaking-wave/FreeRTOS that referenced this pull request Nov 15, 2024
…et (FreeRTOS#1104)

Otherwise it is very reasonable that config_TIMER_TASK_STACK_DEPTH is
undefined.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants