Skip to content

Commit

Permalink
Reset the state of DiscoveryImplPlatform to Uninitialized when ChipDn…
Browse files Browse the repository at this point in the history
…ssdInit fails (#34104)
  • Loading branch information
wqx6 authored and pull[bot] committed Aug 8, 2024
1 parent f273bca commit e3e9d15
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/lib/dnssd/Discovery_ImplPlatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,12 @@ CHIP_ERROR DiscoveryImplPlatform::InitImpl()
VerifyOrReturnError(mState == State::kUninitialized, CHIP_NO_ERROR);
mState = State::kInitializing;

ReturnErrorOnFailure(ChipDnssdInit(HandleDnssdInit, HandleDnssdError, this));
CHIP_ERROR err = ChipDnssdInit(HandleDnssdInit, HandleDnssdError, this);
if (err != CHIP_NO_ERROR)
{
mState = State::kUninitialized;
return err;
}
UpdateCommissionableInstanceName();

return CHIP_NO_ERROR;
Expand Down

0 comments on commit e3e9d15

Please sign in to comment.