lkml.org 
[lkml]   [2011]   [Sep]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [Xen-devel] [PATCH 3/9] xen/pciback: Check if the device is found instead of blindly assuming so.
    >>> On 29.09.11 at 21:52, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
    > Just in case it is not found, don't try to dereference it.
    >
    > Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    > ---
    > drivers/xen/xen-pciback/pci_stub.c | 2 ++
    > 1 files changed, 2 insertions(+), 0 deletions(-)
    >
    > diff --git a/drivers/xen/xen-pciback/pci_stub.c
    > b/drivers/xen/xen-pciback/pci_stub.c
    > index d985b65..55086e9 100644
    > --- a/drivers/xen/xen-pciback/pci_stub.c
    > +++ b/drivers/xen/xen-pciback/pci_stub.c
    > @@ -222,6 +222,8 @@ void pcistub_put_pci_dev(struct pci_dev *dev)
    > }
    >
    > spin_unlock_irqrestore(&pcistub_devices_lock, flags);
    > + if (!found_psdev)
    > + return;

    If this happens, it's a bug (backend controller found the device, but
    the generic backend code didn't), so I would say minimally a WARN_ON()
    should be issued here.

    Jan

    >
    > /*hold this lock for avoiding breaking link between
    > * pcistub and xen_pcibk when AER is in processing






    \
     
     \ /
      Last update: 2011-09-30 09:53    [W:0.025 / U:30.720 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site