devip: correctly return when allocating an ipmedium slot

Previous patch attempted to panic when we ran out of slots,
however the loop needed changes to return early to avoid
the failure case.
This commit is contained in:
Jacob Moody 2024-11-15 01:06:54 +00:00
parent 3f7a323e31
commit 6b8c36d51f

View file

@ -103,7 +103,7 @@ addipmedium(Medium *med)
for(i = 0; i < nelem(media)-1; i++)
if(media[i] == nil){
media[i] = med;
break;
return;
}
panic("addipmedium: too many mediums");
}