Skip to contentSkip to conversation

ATM firestream bug

DISCUSSION Jeff Garzik 3 participants 3 messages Oct 1, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

The gcc warning "may be used uninitialized" is correct here, as well:

drivers/atm/firestream.c: In function ‘top_off_fp’:
drivers/atm/firestream.c:1501: warning: cast to pointer from integer of different size drivers/atm/firestream.c: In function ‘fs_open’:
drivers/atm/firestream.c:870: warning: ‘tmc0’ may be used uninitialized in this function

This indicates two bugs:

1) not safe on 64-bit

2) variable 'tmc0' is indeed potentially used uninit'd, in particular if make_rate() returns an error (use occurs before error check).

#1 lore raw
Quoted 1 line · Jeff Garzik

1) not safe on 64-bit

Almost certainly correct. Probably never will be -- IIRC this SAR was mainly used in embedded apps. I don't know if any commercially-available PCI cards were ever made with it. I could be wrong though, it's been awhile since I was up on the ATM industry.

Quoted 2 lines

2) variable 'tmc0' is indeed potentially used uninit'd, in particular if make_rate() returns an error (use occurs before error check).

Exact same error as the one you spotted in ambassador.c -- make_rate()'s error is not checked at all. It should be.

-Mitch

#2 lore raw
In reply to Jeff Garzik
Quoted 1 line · In message <[email protected]>,Jeff Garzik writes:

1) not safe on 64-bit

firestream is not the only driver that's likely 32-bit safe only. zatm, nicstar, horizon and ambassdor all use virt_to_bus().

Quoted 2 lines

2) variable 'tmc0' is indeed potentially used uninit'd, in particular if make_rate() returns an error (use occurs before error check).

i will fix this later.