summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAaro Koskinen <aaro.koskinen@iki.fi>2011-09-11 00:29:53 +0300
committerGreg Kroah-Hartman <gregkh@suse.de>2011-09-12 16:52:15 +0200
commit3028474cb469ff5352bbc7cc685eee46ab8e888b (patch)
treeb0abd70fa3db4f8d91dbff1ab7ab66d2f4df27b2 /drivers
parent831e5bad5f74d6147d2d70587a230687181e4e00 (diff)
staging: xgifb: properly delete MTRR region
MTRR region should be deleted on probe failure and driver removal. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/xgifb/XGI_main_26.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/staging/xgifb/XGI_main_26.c b/drivers/staging/xgifb/XGI_main_26.c
index db9d27b04ce4..e018b9a43bc0 100644
--- a/drivers/staging/xgifb/XGI_main_26.c
+++ b/drivers/staging/xgifb/XGI_main_26.c
@@ -2424,13 +2424,19 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
if (register_framebuffer(fb_info) < 0) {
ret = -EINVAL;
- goto error_1;
+ goto error_mtrr;
}
dumpVGAReg();
return 0;
+error_mtrr:
+#ifdef CONFIG_MTRR
+ if (xgi_video_info.mtrr >= 0)
+ mtrr_del(xgi_video_info.mtrr, xgi_video_info.video_base,
+ xgi_video_info.video_size);
+#endif /* CONFIG_MTRR */
error_1:
iounmap(xgi_video_info.mmio_vbase);
iounmap(xgi_video_info.video_vbase);
@@ -2451,6 +2457,11 @@ error:
static void __devexit xgifb_remove(struct pci_dev *pdev)
{
unregister_framebuffer(fb_info);
+#ifdef CONFIG_MTRR
+ if (xgi_video_info.mtrr >= 0)
+ mtrr_del(xgi_video_info.mtrr, xgi_video_info.video_base,
+ xgi_video_info.video_size);
+#endif /* CONFIG_MTRR */
iounmap(xgi_video_info.mmio_vbase);
iounmap(xgi_video_info.video_vbase);
release_mem_region(xgi_video_info.mmio_base, xgi_video_info.mmio_size);