Skip to content

Commit

Permalink
[controller] Fixed error handling on session establishment failure (#…
Browse files Browse the repository at this point in the history
…13697)

In #13287
the regression was introduced that starting commissioning,
while an existing commissioning is in progress will cancel it.

* Brought back previous error handling and added clearing
mDeviceBeingCommissioned to allow starting new commissioning
after previous ones fail.
  • Loading branch information
kkasperczyk-no authored and pull[bot] committed Oct 26, 2023
1 parent a5db90f commit 2440546
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/controller/CHIPDeviceController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,17 @@ CHIP_ERROR DeviceCommissioner::EstablishPASEConnection(NodeId remoteDeviceId, Re
exit:
if (err != CHIP_NO_ERROR)
{
RendezvousCleanup(err);
// Delete the current rendezvous session only if a device is not currently being paired.
if (mDeviceBeingCommissioned == nullptr)
{
FreeRendezvousSession();
}

if (device != nullptr)
{
ReleaseCommissioneeDevice(device);
mDeviceBeingCommissioned = nullptr;
}
}

return err;
Expand Down

0 comments on commit 2440546

Please sign in to comment.