Skip to contentSkip to conversation

2.4.0 tulip bug (was: And oh, btw..)

DISCUSSION Mikael Pettersson 2 participants 2 messages Jan 5, 2001

lore
Share & tools
lore
#0 lore raw
Quoted 4 lines · Linus Torvalds

Changes since the prerelease:
...
Matti Aarnio:
- teach tulip driver about media types 5 and 6

This part of the patch introduces a bug in 2.4.0, as noticed by gcc:

media.c: In function `tulip_select_media':
media.c:268: warning: unused variable `csr15val'
media.c:268: warning: unused variable `csr15dir'
media.c:268: warning: unused variable `csr14val'
media.c:268: warning: unused variable `csr13val'
media.c:151: warning: `new_csr6' might be used uninitialized in this function

The last warning indicates a real problem. The patch adds a new control flow path in which new_csr6 is _not_ assigned a value, which causes the procedure's second last statement

	tp->csr6 = new_csr6 | (tp->csr6 & 0xfdff) | (tp->full_duplex ? 0x0200 : 0);

to 'or' random bits into tp->csr6.

The patch also adds four unused variables, which looks rather fishy.

/Mikael
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/

#1 lore raw
Quoted 6 lines · Mikael Pettersson
Quoted 4 lines

Changes since the prerelease:
...
Matti Aarnio:
- teach tulip driver about media types 5 and 6

This part of the patch introduces a bug in 2.4.0, as noticed by gcc:

Oddly enough the beast works with my test specimen, but real analysis is still incomplete by Donald et.al.

So far we think that if the card has MII (type 1) media, it could safely ignore types 5 and 6.

Quoted 1 line

The patch also adds four unused variables, which looks rather fishy.

Indeed, it is copy&paste from somewhere else, which may indeed have different control flows.

However unless you have esoteric (taiwanese) special hardware with those media types, it won't affect you.

Quoted 1 line

/Mikael

/Matti Aarnio
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/