aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/src/mac.c
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/src/mac.c')
-rw-r--r--os/hal/src/mac.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/os/hal/src/mac.c b/os/hal/src/mac.c
index 48656a8a3..9d033fe33 100644
--- a/os/hal/src/mac.c
+++ b/os/hal/src/mac.c
@@ -123,8 +123,10 @@ msg_t macWaitTransmitDescriptor(MACDriver *macp,
(time > 0)) {
chSysLock();
systime_t now = chTimeNow();
- if ((msg = chSemWaitTimeoutS(&macp->md_tdsem, time)) == RDY_TIMEOUT)
+ if ((msg = chSemWaitTimeoutS(&macp->md_tdsem, time)) == RDY_TIMEOUT) {
+ chSysUnlock();
break;
+ }
if (time != TIME_INFINITE)
time -= (chTimeNow() - now);
chSysUnlock();
@@ -173,8 +175,10 @@ msg_t macWaitReceiveDescriptor(MACDriver *macp,
(time > 0)) {
chSysLock();
systime_t now = chTimeNow();
- if ((msg = chSemWaitTimeoutS(&macp->md_rdsem, time)) == RDY_TIMEOUT)
+ if ((msg = chSemWaitTimeoutS(&macp->md_rdsem, time)) == RDY_TIMEOUT) {
+ chSysUnlock();
break;
+ }
if (time != TIME_INFINITE)
time -= (chTimeNow() - now);
chSysUnlock();