Hm, I think we should probably just check in pci_get_device() to verify
that ->next is really valid. If it isn't just return NULL, as we have
no idea what the next device would possibly be. The worse thing that
would happen is the proc file would be a bit shorter than expected. If
read again, it would be correct, with the previously referenced device
now gone.
I don't want to try to hold a lock over start/next/stop as that would
just be asking for trouble :)
Sound acceptable?
> > +struct pci_dev *
> > +pci_get_subsys(unsigned int vendor, unsigned int device,
> <snip>
> > +exit:
> > + if (from)
> > + pci_put_dev(from);
> > + if (dev)
> > + pci_get_dev(dev);
>
> Heh, the hch in me notes that pci_{put,get}_dev already check NULL device ;-)
Heh, good point, I'll go fix that :)
thanks for looking at this,
greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/