agp: Fix a kernel panic on boot issue
authorFrançois Tigeot <ftigeot@wolfpond.org>
Wed, 5 Dec 2012 07:19:40 +0000 (08:19 +0100)
committerFrançois Tigeot <ftigeot@wolfpond.org>
Wed, 5 Dec 2012 17:40:54 +0000 (18:40 +0100)
* A pointer wasn't correctly initialized, leading to a
  Fatal trap 12: page fault while in kernel mode panic

* This commit fixes bug report #2467

Tested-by: Eric Christeson, David Shao
sys/dev/agp/agp.c

index 13d7f68..0a7cb8f 100644 (file)
@@ -237,8 +237,8 @@ agp_generic_attach(device_t dev)
        TAILQ_INIT(&sc->as_memory);
        sc->as_nextid = 1;
 
-       make_dev(&agp_ops, device_get_unit(dev), UID_ROOT, GID_WHEEL,
-                0600, "agpgart");
+       sc->as_devnode = make_dev(&agp_ops,
+           0, UID_ROOT, GID_WHEEL, 0600, "agpgart");
        sc->as_devnode->si_drv1 = dev;
 
        return 0;