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]
Date:   Mon, 29 Jun 2020 06:51:20 +0000
From:   Pawel Laszczak <pawell@...ence.com>
To:     Dan Carpenter <dan.carpenter@...cle.com>
CC:     "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
        "robh+dt@...nel.org" <robh+dt@...nel.org>,
        "linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "balbi@...nel.org" <balbi@...nel.org>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
        "ben.dooks@...ethink.co.uk" <ben.dooks@...ethink.co.uk>,
        "colin.king@...onical.com" <colin.king@...onical.com>,
        "rogerq@...com" <rogerq@...com>,
        "peter.chen@....com" <peter.chen@....com>,
        "weiyongjun1@...wei.com" <weiyongjun1@...wei.com>,
        Jayshri Dajiram Pawar <jpawar@...ence.com>,
        Rahul Kumar <kurahul@...ence.com>,
        Sanket Parmar <sparmar@...ence.com>
Subject: RE: [PATCH RFC 2/5] usb:cdns3: Add pci to platform driver wrapper


>
>On Fri, Jun 26, 2020 at 03:10:32PM +0000, Pawel Laszczak wrote:
>> >> +static int cdnsp_pci_probe(struct pci_dev *pdev,
>> >> +			   const struct pci_device_id *id)
>> >> +{
>> >> +	struct platform_device_info plat_info;
>> >> +	struct cdnsp_wrap *wrap;
>> >> +	struct resource *res;
>> >> +	struct pci_dev *func;
>> >> +	int err;
>> >> +
>> >> +	/*
>> >> +	 * For GADGET/HOST PCI (devfn) function number is 0,
>> >> +	 * for OTG PCI (devfn) function number is 1.
>> >> +	 */
>> >> +	if (!id || (pdev->devfn != PCI_DEV_FN_HOST_DEVICE &&
>> >> +		    pdev->devfn != PCI_DEV_FN_OTG))
>> >> +		return -EINVAL;
>> >> +
>> >> +	func = cdnsp_get_second_fun(pdev);
>> >> +	if (unlikely(!func))
>> >> +		return -EINVAL;
>> >> +
>> >> +	if (func->class == PCI_CLASS_SERIAL_USB_XHCI ||
>> >> +	    pdev->class == PCI_CLASS_SERIAL_USB_XHCI)
>> >> +		return -EINVAL;
>> >
>> >
>> >Do we need call pci_put_device(func) before returning?
>>
>> We don't need.
>> Such function doesn't exist.
>>
>
>I meant pci_dev_put().  I'm pretty sure that we do need it to match the
>pci_get_device() in cdnsp_get_second_fun().

Right, I will add this,

>
>regards,
>dan carpenter

regards,
pawel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ