Skip to content

Commit bc22eb7

Browse files
authored
Merge pull request #716 from fjtrujy/fixSemSIF
Delete semaphore on E_SIF_PKT_SEND error
2 parents 2e3825f + e94acaa commit bc22eb7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ee/kernel/src/sifrpc.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ int SifBindRpc(SifRpcClientData_t *cd, int sid, int mode)
148148

149149
if (!SifSendCmd(SIF_CMD_RPC_BIND, bind, RPC_PACKET_SIZE, NULL, NULL, 0)) {
150150
rpc_packet_free(bind);
151+
DeleteSema(cd->hdr.sema_id);
151152
return -E_SIF_PKT_SEND;
152153
}
153154

@@ -214,6 +215,7 @@ int SifCallRpc(SifRpcClientData_t *cd, int rpc_number, int mode,
214215

215216
if (!SifSendCmd(SIF_CMD_RPC_CALL, call, RPC_PACKET_SIZE, sendbuf, cd->buff, ssize)) {
216217
rpc_packet_free(call);
218+
DeleteSema(cd->hdr.sema_id);
217219
return -E_SIF_PKT_SEND;
218220
}
219221

@@ -263,6 +265,7 @@ int SifRpcGetOtherData(SifRpcReceiveData_t *rd, void *src, void *dest,
263265

264266
if (!SifSendCmd(SIF_CMD_RPC_RDATA, other, RPC_PACKET_SIZE, NULL, NULL, 0)) {
265267
rpc_packet_free(other);
268+
DeleteSema(rd->hdr.sema_id);
266269
return -E_SIF_PKT_SEND;
267270
}
268271

0 commit comments

Comments
 (0)