Messages in this thread | | | From | "Sean Estabrooks" <> | Subject | Bug in "ide-pci.c" | Date | Fri, 6 Oct 2000 19:20:22 -0400 |
| |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=Content-Type content="text/html; charset=iso-8859-1"> <META content="MSHTML 5.50.4134.600" name=GENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=#ffffff> <DIV><FONT face=Arial size=2>ide-pci.c bug:</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>ide_setup_pci_baseregs() may inappropriately report device as not capable of full native PCI:</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>// BUGGY LINE: ============</FONT></DIV> <DIV><FONT face=Arial size=2> if (pci_read_config_byte(dev, PCI_CLASS_PROG, &progif) || (progif & 5) != 5) {<BR>// ========= TWO CONDITIONS USING PROGIF </FONT></DIV> <DIV><FONT face=Arial size=2> if ((progif & 0xa) != 0xa) {<BR> printk("%s: device not capable of full native PCI mode\n", name);<BR> return 1;<BR> }</DIV> <DIV> </DIV> <DIV> ...</DIV> <DIV> </DIV> <DIV> In the first line of code above there is no guarantee that the first condition will be executed</DIV> <DIV>before the second. As progif is set to 0 before this block of code, the second test will always</DIV> <DIV>be true if it is executed prior to the first.</DIV> <DIV> </DIV> <DIV></FONT> </DIV></BODY></HTML>
| |