From: Dave Airlie Date: Wed, 11 Jan 2006 11:32:51 +0000 (+1100) Subject: drm: cleanup properly on drm module unload X-Git-Tag: v2.6.16-rc1~178^2~1 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aab8df141fdc4c4c9587521a24b6865390eaeb79;p=linux-2.6 drm: cleanup properly on drm module unload Cleanup multiple cards properly Signed-off-by: Dave Airlie --- diff --git a/drivers/char/drm/drm_drv.c b/drivers/char/drm/drm_drv.c index 5714d7badc..c4fa5a2958 100644 --- a/drivers/char/drm/drm_drv.c +++ b/drivers/char/drm/drm_drv.c @@ -342,12 +342,12 @@ void drm_exit(struct drm_driver *driver) if (head->dev->driver != driver) continue; dev = head->dev; - } - if (dev) { - /* release the pci driver */ - if (dev->pdev) - pci_dev_put(dev->pdev); - drm_cleanup(dev); + if (dev) { + /* release the pci driver */ + if (dev->pdev) + pci_dev_put(dev->pdev); + drm_cleanup(dev); + } } DRM_INFO("Module unloaded\n"); }