Anybody want to suggest a patch?  It may be important to reuse the lis_pci_dev_t so that a driver can save this pointer and keep it.
-- Dave

At 05:41 PM 3/12/2004, Eugene LiS User wrote:

Hello Dave,

The lis_pci_find_device() function has a problem.

It calls native pci_find_device() function only once for given vendor
and device ids in slot. This approach does not work good for the
hot plug-able devices, since Linux deallocates pci_dev structure
when card is removed and allocates new pci_dev structure when card
is plugged back in.

As a result, when the lis_pci_find_device() function is called from,
say, driver's probe function for device that is re-inserted,  it returns
lis_pci_dev pointer that in turn refers to a pci_dev pointer
(through kern_ptr) that is no longer valid.

The offending code is this one:
while(p != NULL)                                              
{
    if (p->vendor == vendor && p->device == device) return(p) ; <----- (1)
    p = p->next;
}
kp = pci_find_device(vendor, device, prev_kp) ; (2)


The (1) returns without calling (2), with an old kern_ptr pointer.
That causes problems(like system panic) when card is re-inserted
since old kern_ptr pointer is invalid then.

It looks to me like,  pci_find_device() should be called every time
the lis_pci_find_device() is called. No shortcuts.

The lis_pci_find_class(), lis_pci_find_slot() are susceptible to the same problem.


--
Eugene


__________________________________________________________________
Introducing the New Netscape Internet Service.
Only $9.95 a month -- Sign up today at http://isp.netscape.com/register

Netscape. Just the Net You Need.

New! Netscape Toolbar for Internet Explorer
Search from anywhere on the Web and block those annoying pop-ups.
Download now at http://channels.netscape.com/ns/search/install.jsp
_______________________________________________
Linux-streams mailing list
[EMAIL PROTECTED]
http://gsyc.escet.urjc.es/mailman/listinfo/linux-streams


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.614 / Virus Database: 393 - Release Date: 3/5/2004
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.614 / Virus Database: 393 - Release Date: 3/5/2004

Reply via email to