OSDN Git Service

drm: check for NULL fb here, shouldn't happen but avoid oops for now
authorDave Airlie <airlied@linux.ie>
Thu, 8 May 2008 06:11:25 +0000 (16:11 +1000)
committerDave Airlie <airlied@linux.ie>
Thu, 8 May 2008 06:11:25 +0000 (16:11 +1000)
linux-core/intel_fb.c

index 63491b6..7df1525 100644 (file)
@@ -754,7 +754,12 @@ EXPORT_SYMBOL(intelfb_probe);
 int intelfb_remove(struct drm_device *dev, struct drm_crtc *crtc)
 {
        struct drm_framebuffer *fb = crtc->fb;
-       struct fb_info *info = fb->fbdev;
+       struct fb_info *info;
+
+       if (!fb)
+               return -EINVAL;
+
+       info = fb->fbdev;
        
        if (info) {
                unregister_framebuffer(info);