mirror of
https://github.com/espressif/openthread.git
synced 2026-08-09 04:07:47 +00:00
[static-analysis] address static code analysis issues (#6651)
We have run the static code analyser on the OpenThread code and some issues were discovered. This commit addresses those that were marked as High impact and were not marked false positive after the inspection. Signed-off-by: Marek Porwisz <[email protected]>
This commit is contained in:
@@ -272,12 +272,17 @@ void DataPollHandler::HandleSentFrame(const Mac::TxFrame &aFrame, Error aError,
|
||||
{
|
||||
uint32_t frameCounter;
|
||||
uint8_t keyId;
|
||||
Error error;
|
||||
|
||||
IgnoreError(aFrame.GetFrameCounter(frameCounter));
|
||||
error = aFrame.GetFrameCounter(frameCounter);
|
||||
OT_ASSERT(error == kErrorNone);
|
||||
aChild.SetIndirectFrameCounter(frameCounter);
|
||||
|
||||
IgnoreError(aFrame.GetKeyId(keyId));
|
||||
error = aFrame.GetKeyId(keyId);
|
||||
OT_ASSERT(error == kErrorNone);
|
||||
aChild.SetIndirectKeyId(keyId);
|
||||
|
||||
OT_UNUSED_VARIABLE(error);
|
||||
}
|
||||
|
||||
ExitNow();
|
||||
|
||||
@@ -911,7 +911,7 @@ template <> otError NcpBase::HandlePropertySet<SPINEL_PROP_THREAD_ASSISTING_PORT
|
||||
{
|
||||
uint16_t port;
|
||||
|
||||
IgnoreError(mDecoder.ReadUint16(port));
|
||||
SuccessOrExit(error = mDecoder.ReadUint16(port));
|
||||
SuccessOrExit(error = otIp6AddUnsecurePort(mInstance, port));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user