net: app: prevent setting semaphore limit to 0

When neither IPv4 nor IPv6 are selected the limit that is
passed to k_sem_init will end up being 0, which will trigger
the folowing assertion in k_sem_init;

__ASSERT(limit != 0, "limit cannot be zero");

Fixed by not passing count as initial and limit value but
only as initial value and use UINT_MAX as limit.

Signed-off-by: Erwin Rol <erwin@erwinrol.com>
This commit is contained in:
Erwin Rol 2017-07-03 21:10:40 +02:00 committed by Anas Nashif
commit a0fc5d8229

View file

@ -203,7 +203,7 @@ int net_app_init(const char *app_info, u32_t flags, s32_t timeout)
count++; count++;
} }
k_sem_init(&counter, count, count); k_sem_init(&counter, count, UINT_MAX);
setup_ipv4(iface); setup_ipv4(iface);