nrf802154: don't call memcpy if iolist->iol_len==0#11176
Conversation
|
I dont really get the necessity for this PR. Afaik memcpy is able to handle size zero and len will not increase either. Am I wrong? |
The issue here is not that the
This is just a really small runtime optimization from my side, didn't affect the size of the final binary. |
Wouldn't it be smarter to test |
You're probably right…, will update |
|
So uhm, What I want to say is that the fixup is not necessary - testing on length should be sufficient as it was. But i'd like a comment then, so if anyone reads this, the reasoning behind this check is clear on first sight. |
Whahaha! 😆 |
Thats what I would do :D |
6187f5b to
e756bf2
Compare
|
@SemjonKerner Added a new fixup commit that clarifies the conditional a bit. |
|
As expect this PR works with and without the fix as intended. |
e756bf2 to
b4bb144
Compare
|
Squashed, thanks for the review! |
|
Thank you for your contribution :) |
Contribution description
Should fix an ubsan complaint as memcpy with
iol->iol_base==NULLis undefined.Testing procedure
Preferably with the procedure lined out in #11163
Issues/PRs references
related: #10782 and #11163