Fix BUG23230: unlock mutex if sys_mbox_trypost() finds a full mail box

This commit is contained in:
kieranm 2008-05-30 11:41:51 +00:00
parent 43c61c1317
commit d959889ab5

View File

@ -227,8 +227,10 @@ sys_mbox_trypost(struct sys_mbox *mbox, void *msg)
LWIP_DEBUGF(SYS_DEBUG, ("sys_mbox_trypost: mbox %p msg %p\n",
(void *)mbox, (void *)msg));
if ((mbox->last + 1) >= (mbox->first + SYS_MBOX_SIZE))
if ((mbox->last + 1) >= (mbox->first + SYS_MBOX_SIZE)) {
sys_sem_signal(mbox->mutex);
return ERR_MEM;
}
mbox->msgs[mbox->last % SYS_MBOX_SIZE] = msg;