diff --git a/net/tipc/eth_media.c b/net/tipc/eth_media.c index 81253d0b24b9d0cd2780602cac850f95d379c070..673fdf0b3222f9ae439e4d3e522439bbc13b8b56 100644 --- a/net/tipc/eth_media.c +++ b/net/tipc/eth_media.c @@ -142,6 +142,16 @@ static int enable_bearer(struct tipc_bearer *tb_ptr) struct eth_bearer *eb_ptr = ð_bearers[0]; struct eth_bearer *stop = ð_bearers[MAX_ETH_BEARERS]; char *driver_name = strchr((const char *)tb_ptr->name, ':') + 1; + int pending_dev = 0; + + /* Find unused Ethernet bearer structure */ + + while (eb_ptr->dev) { + if (!eb_ptr->bearer) + pending_dev++; + if (++eb_ptr == stop) + return pending_dev ? -EAGAIN : -EDQUOT; + } /* Find device with specified name */