[PATCH] Fix oops in MGA DRM on root bus.

Subsystems: char and misc drivers, the rest

STALE7635d

2 messages, 1 author, 2005-11-20 · open the first message on its own page

[PATCH] Fix oops in MGA DRM on root bus.

From: David Woodhouse <dwmw2@infradead.org>
Date: 2005-11-19 23:20:04

I think that if a PCI bus is a root bus, attached to a host bridge not a
PCI->PCI bridge, then bus->self is allowed to be NULL. Certainly that's
the case on my Pegasos, and it makes the MGA DRM driver oops...

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
diff --git a/drivers/char/drm/mga_drv.c b/drivers/char/drm/mga_drv.c
--- a/drivers/char/drm/mga_drv.c
+++ b/drivers/char/drm/mga_drv.c
@@ -161,7 +161,7 @@ static int mga_driver_device_is_agp(drm_
 	 * device.
 	 */
 
-	if ((pdev->device == 0x0525)
+	if ((pdev->device == 0x0525) && pdev->bus->self &&
 	    && (pdev->bus->self->vendor == 0x3388)
 	    && (pdev->bus->self->device == 0x0021)) {
 		return 0;
-- 
dwmw2

Re: [PATCH] Fix oops in MGA DRM on root bus.

From: David Woodhouse <dwmw2@infradead.org>
Date: 2005-11-20 00:08:08

On Sat, 2005-11-19 at 23:19 +0000, David Woodhouse wrote:
quoted hunk
-       if ((pdev->device == 0x0525)
+       if ((pdev->device == 0x0525) && pdev->bus->self &&
            && (pdev->bus->self->vendor == 0x3388)
            && (pdev->bus->self->device == 0x0021)) {
                return 0;
Perhaps with one fewer '&&'...
diff --git a/drivers/char/drm/mga_drv.c b/drivers/char/drm/mga_drv.c
--- a/drivers/char/drm/mga_drv.c
+++ b/drivers/char/drm/mga_drv.c
@@ -161,7 +161,7 @@ static int mga_driver_device_is_agp(drm_
 	 * device.
 	 */
 
-	if ((pdev->device == 0x0525)
+	if ((pdev->device == 0x0525) && pdev->bus->self
 	    && (pdev->bus->self->vendor == 0x3388)
 	    && (pdev->bus->self->device == 0x0021)) {
 		return 0;
-- 
dwmw2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help