From 62838b948cdddc0f007c200fbec195c1a008c731 Mon Sep 17 00:00:00 2001 From: Gareth Hughes Date: Sat, 1 Jul 2000 01:50:00 +0000 Subject: Fix for agpgart module detection. If the kernel module has been configured to use AGP, and the module is not present, fail gracefully instead of doing evil things. --- linux/r128_drv.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'linux/r128_drv.c') diff --git a/linux/r128_drv.c b/linux/r128_drv.c index 8b669888a..4c0655514 100644 --- a/linux/r128_drv.c +++ b/linux/r128_drv.c @@ -369,6 +369,13 @@ int r128_init(void) #ifdef DRM_AGP dev->agp = drm_agp_init(); + if (dev->agp == NULL) { + DRM_ERROR("Cannot initialize agpgart module.\n"); + drm_proc_cleanup(); + misc_deregister(&r128_misc); + r128_takedown(dev); + return -ENOMEM; + } #ifdef CONFIG_MTRR dev->agp->agp_mtrr = mtrr_add(dev->agp->agp_info.aper_base, -- cgit v1.2.3