zynq: fix out of bounds access in etherprobe()
calling etherprobe() with -1 cardno will rereference and call cards[-1].reset() which is wrong. don't do that!
This commit is contained in:
parent
0bc9ad781f
commit
4687e196cc
|
@ -435,12 +435,6 @@ etherreset(void)
|
|||
Ether *ether;
|
||||
int cardno, ctlrno;
|
||||
|
||||
for(ctlrno = 0; ctlrno < MaxEther; ctlrno++){
|
||||
if((ether = etherprobe(-1, ctlrno)) == nil)
|
||||
continue;
|
||||
etherxx[ctlrno] = ether;
|
||||
}
|
||||
|
||||
cardno = ctlrno = 0;
|
||||
while(cards[cardno].type != nil && ctlrno < MaxEther){
|
||||
if(etherxx[ctlrno] != nil){
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
enum {
|
||||
MaxEther = 64,
|
||||
MaxEther = 1,
|
||||
Ntypes = 8,
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue