mirror of
git://git.9front.org/plan9front/plan9front
synced 2025-01-12 11:10:06 +00:00
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:
parent
3f7a323e31
commit
6b8c36d51f
1 changed files with 1 additions and 1 deletions
|
@ -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");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue