lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210731120836.vegno6voijvlflws@pengutronix.de>
Date:   Sat, 31 Jul 2021 14:08:36 +0200
From:   Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
To:     Boris Ostrovsky <boris.ostrovsky@...cle.com>
Cc:     Bjorn Helgaas <bhelgaas@...gle.com>,
        Mark Rutland <mark.rutland@....com>,
        Giovanni Cabiddu <giovanni.cabiddu@...el.com>,
        Rafał Miłecki <zajec5@...il.com>,
        Peter Zijlstra <peterz@...radead.org>,
        linux-pci@...r.kernel.org, Alexander Duyck <alexanderduyck@...com>,
        Russell Currey <ruscur@...sell.cc>,
        Sathya Prakash <sathya.prakash@...adcom.com>,
        oss-drivers@...igine.com, Oliver O'Halloran <oohall@...il.com>,
        "H. Peter Anvin" <hpa@...or.com>, Jiri Olsa <jolsa@...hat.com>,
        linux-perf-users@...r.kernel.org,
        Stefano Stabellini <sstabellini@...nel.org>,
        Herbert Xu <herbert@...dor.apana.org.au>,
        linux-scsi@...r.kernel.org, Michael Ellerman <mpe@...erman.id.au>,
        Ido Schimmel <idosch@...dia.com>, x86@...nel.org,
        qat-linux@...el.com,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Ingo Molnar <mingo@...hat.com>,
        Geert Uytterhoeven <geert@...ux-m68k.org>,
        Benjamin Herrenschmidt <benh@...nel.crashing.org>,
        linux-wireless@...r.kernel.org, Jakub Kicinski <kuba@...nel.org>,
        Mathias Nyman <mathias.nyman@...el.com>,
        Yisen Zhuang <yisen.zhuang@...wei.com>,
        Fiona Trahe <fiona.trahe@...el.com>,
        Andrew Donnellan <ajd@...ux.ibm.com>,
        Arnd Bergmann <arnd@...db.de>,
        Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
        Suganath Prabu Subramani 
        <suganath-prabu.subramani@...adcom.com>,
        Simon Horman <simon.horman@...igine.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Borislav Petkov <bp@...en8.de>, Michael Buesch <m@...s.ch>,
        Jiri Pirko <jiri@...dia.com>,
        Namhyung Kim <namhyung@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Andy Shevchenko <andriy.shevchenko@...el.com>,
        Juergen Gross <jgross@...e.com>,
        Salil Mehta <salil.mehta@...wei.com>,
        Sreekanth Reddy <sreekanth.reddy@...adcom.com>,
        xen-devel@...ts.xenproject.org, Vadym Kochan <vkochan@...vell.com>,
        MPT-FusionLinux.pdl@...adcom.com,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-usb@...r.kernel.org,
        Wojciech Ziemba <wojciech.ziemba@...el.com>,
        linux-kernel@...r.kernel.org, Taras Chornyi <tchornyi@...vell.com>,
        Zhou Wang <wangzhou1@...ilicon.com>,
        linux-crypto@...r.kernel.org, kernel@...gutronix.de,
        netdev@...r.kernel.org, Frederic Barrat <fbarrat@...ux.ibm.com>,
        Paul Mackerras <paulus@...ba.org>,
        linuxppc-dev@...ts.ozlabs.org,
        "David S. Miller" <davem@...emloft.net>
Subject: Re: [PATCH v1 4/5] PCI: Adapt all code locations to not use struct
 pci_dev::driver directly

Hello Boris,

On Fri, Jul 30, 2021 at 04:37:31PM -0400, Boris Ostrovsky wrote:
> On 7/29/21 4:37 PM, Uwe Kleine-König wrote:
> > --- a/drivers/pci/xen-pcifront.c
> > +++ b/drivers/pci/xen-pcifront.c
> > @@ -599,12 +599,12 @@ static pci_ers_result_t pcifront_common_process(int cmd,
> >  	result = PCI_ERS_RESULT_NONE;
> >  
> >  	pcidev = pci_get_domain_bus_and_slot(domain, bus, devfn);
> > -	if (!pcidev || !pcidev->driver) {
> > +	pdrv = pci_driver_of_dev(pcidev);
> > +	if (!pcidev || !pdrv) {
> 
> If pcidev is NULL we are dead by the time we reach 'if' statement.

Oh, you're right. So this needs something like:

	if (!pcidev || !(pdrv = pci_driver_of_dev(pcidev)))

or repeating the call to pci_driver_of_dev for each previous usage of
pdev->driver.

If there are no other preferences I'd got with the first approach for
v2.

Best regards and thanks for catching,
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ