[settings] reset the platform settings file descriptor once closed (#10512)

On platform settings deinit, the file descriptor is closed but the
variable is not reset, which can lead to calling close on a stale fd
leading to bad file descriptor error in case the API is invoked
multiple times.
This commit is contained in:
sarveshkumarv3
2024-07-15 11:17:09 -07:00
committed by GitHub
parent 6f2d8b6b22
commit b301a4c43f
+1
View File
@@ -232,6 +232,7 @@ void otPlatSettingsDeinit(otInstance *aInstance)
VerifyOrExit(sSettingsFd != -1);
VerifyOrDie(close(sSettingsFd) == 0, OT_EXIT_ERROR_ERRNO);
sSettingsFd = -1;
exit:
return;