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: <CAE9FiQVP7Q2p2zN8pXubcgx=7CFAt9pw0tWcWpuPddO9U7pR5A@mail.gmail.com>
Date:	Fri, 21 Sep 2012 14:18:00 -0700
From:	Yinghai Lu <yinghai@...nel.org>
To:	Bjorn Helgaas <bhelgaas@...gle.com>
Cc:	Len Brown <lenb@...nel.org>,
	Taku Izumi <izumi.taku@...fujitsu.com>,
	Jiang Liu <jiang.liu@...wei.com>, x86 <x86@...nel.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-acpi@...r.kernel.org, Dave Airlie <airlied@...hat.com>,
	Julia Lawall <julia@...u.dk>, Matthew Garrett <mjg@...hat.com>
Subject: Re: [PATCH 01/40] PCI: fix default vga ref_count

On Fri, Sep 21, 2012 at 1:52 PM, Bjorn Helgaas <bhelgaas@...gle.com> wrote:
> On Wed, Sep 19, 2012 at 12:54 PM, Yinghai Lu <yinghai@...nel.org> wrote:
>> --- a/drivers/gpu/vga/vgaarb.c
>> +++ b/drivers/gpu/vga/vgaarb.c
>> @@ -141,6 +141,12 @@ EXPORT_SYMBOL_GPL(vga_default_device);
>>
>>  void vga_set_default_device(struct pci_dev *pdev)
>>  {
>> +       if (vga_default)
>> +               pci_dev_put(vga_default);
>> +
>> +       if (pdev)
>> +               pdev = pci_dev_get(pdev);
>> +
>>         vga_default = pdev;
>
> I think this is equivalent to:
>
>     pci_dev_put(vga_default);
>     vga_default = pci_dev_get(pdev);

ah, i missed that, pci_dev_put and pci_dev_get check that inside.

>
> I haven't seen an answer to Matthew's question about whether we want
> to check for "vga_default == pdev".

yes, that could avoid the extra put/get pair.

Please check updated version.

-Yinghai

Download attachment "fix_vgarab_add_x.patch" of type "application/octet-stream" (2560 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ