net_ioballoc: remove redundant critical section

This commit is contained in:
YAMAMOTO Takashi 2021-07-20 20:40:42 +09:00 committed by Xiang Xiao
parent b5bb0d56ad
commit 0272a16010

View file

@ -499,7 +499,6 @@ FAR struct iob_s *net_ioballoc(bool throttled, enum iob_user_e consumerid)
iob = iob_tryalloc(throttled, consumerid);
if (iob == NULL)
{
irqstate_t flags;
unsigned int count;
int blresult;
@ -507,15 +506,12 @@ FAR struct iob_s *net_ioballoc(bool throttled, enum iob_user_e consumerid)
* become available. But let's not do that with the network locked.
*/
flags = enter_critical_section();
blresult = net_breaklock(&count);
iob = iob_alloc(throttled, consumerid);
if (blresult >= 0)
{
net_restorelock(count);
}
leave_critical_section(flags);
}
return iob;