lkml.org 
[lkml]   [2005]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: AGP bogosities
    On Fri, Mar 11, 2005 at 01:18:36PM +1100, Paul Mackerras wrote:
    > Dave Jones writes:
    >
    > > > cap_ptr = pci_find_capability(device, PCI_CAP_ID_AGP);
    > > > - if (!cap_ptr) {
    > > > - pci_dev_put(device);
    > > > - continue;
    > > > - }
    > > > - cap_ptr = 0;
    > > > }
    > >
    > > This part I'm not so sure about.
    > > The pci_get_class() call a few lines above will get a refcount that
    > > we will now never release.
    >
    > The point is that pci_get_class does a pci_dev_put() on the "from"
    > parameter, so your code ended up doing a double put.

    After it does that pci_dev_put on the from, it does another pci_dev_get
    on 'dev', which is what my put was releasing.

    Or am I terribly confused ?

    Dave

    -
    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/

    \
     
     \ /
      Last update: 2005-03-22 14:11    [W:0.027 / U:0.492 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site