[Intel-gfx] [PATCH] drm/i915: fix pch pci device enumeration

2014-02-14 Thread Imre Deak
pci_get_class(class, from) drops the refcount for 'from', so the extra pci_dev_put we do on it will result in a use after free bug sometime later starting with the WARN below. Regression introduced in commit 6a9c4b35e6696a63805b6da5e4889c6986e9ee1b Author: Rui Guo

Re: [Intel-gfx] [PATCH] drm/i915: fix pch pci device enumeration

2014-02-14 Thread Chris Wilson
On Fri, Feb 14, 2014 at 07:23:32PM +0200, Imre Deak wrote: pci_get_class(class, from) drops the refcount for 'from', so the extra pci_dev_put we do on it will result in a use after free bug sometime later starting with the WARN below. That's a very nice find. But you can tidy this loop up

Re: [Intel-gfx] [PATCH] drm/i915: fix pch pci device enumeration

2014-02-14 Thread Imre Deak
On Fri, 2014-02-14 at 17:35 +, Chris Wilson wrote: On Fri, Feb 14, 2014 at 07:23:32PM +0200, Imre Deak wrote: pci_get_class(class, from) drops the refcount for 'from', so the extra pci_dev_put we do on it will result in a use after free bug sometime later starting with the WARN below.

Re: [Intel-gfx] [PATCH] drm/i915: fix pch pci device enumeration

2014-02-14 Thread Chris Wilson
On Fri, Feb 14, 2014 at 07:48:18PM +0200, Imre Deak wrote: On Fri, 2014-02-14 at 17:35 +, Chris Wilson wrote: @@ -382,18 +379,15 @@ void intel_detect_pch(struct drm_device *dev) DRM_DEBUG_KMS(Found LynxPoint LP PCH\n);