aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/agp/intel-agp.c
diff options
context:
space:
mode:
authorScott Thompson <postfail at hushmail.com>2007-08-25 04:14:00 -0400
committerDave Airlie <airlied@linux.ie>2007-08-25 04:14:00 -0400
commit5bdbc7dc2c07d507b41bffdadc2c8cc13b2d4326 (patch)
tree028f10ec31f041f97934c3fd6b66eabb81444ed8 /drivers/char/agp/intel-agp.c
parent32ddef98f232585f20bc8bdb891029a6a5f633d0 (diff)
agp: balance ioremap checks
patchset against 2.6.23-rc3. corrects missing ioremap return checks and balancing on iounmap calls, integrated changes per list recommendations on the original set of patches.. Signed-off-by: Scott Thompson <postfail <at> hushmail.com> Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/char/agp/intel-agp.c')
-rw-r--r--drivers/char/agp/intel-agp.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c
index 294cdbf4d44d..2c9ca2c64628 100644
--- a/drivers/char/agp/intel-agp.c
+++ b/drivers/char/agp/intel-agp.c
@@ -930,8 +930,10 @@ static int intel_i915_create_gatt_table(struct agp_bridge_data *bridge)
930 temp &= 0xfff80000; 930 temp &= 0xfff80000;
931 931
932 intel_private.registers = ioremap(temp,128 * 4096); 932 intel_private.registers = ioremap(temp,128 * 4096);
933 if (!intel_private.registers) 933 if (!intel_private.registers) {
934 iounmap(intel_private.gtt);
934 return -ENOMEM; 935 return -ENOMEM;
936 }
935 937
936 temp = readl(intel_private.registers+I810_PGETBL_CTL) & 0xfffff000; 938 temp = readl(intel_private.registers+I810_PGETBL_CTL) & 0xfffff000;
937 global_cache_flush(); /* FIXME: ? */ 939 global_cache_flush(); /* FIXME: ? */
@@ -985,13 +987,15 @@ static int intel_i965_create_gatt_table(struct agp_bridge_data *bridge)
985 temp &= 0xfff00000; 987 temp &= 0xfff00000;
986 intel_private.gtt = ioremap((temp + (512 * 1024)) , 512 * 1024); 988 intel_private.gtt = ioremap((temp + (512 * 1024)) , 512 * 1024);
987 989
988 if (!intel_private.gtt) 990 if (!intel_private.gtt)
989 return -ENOMEM; 991 return -ENOMEM;
990 992
991 993
992 intel_private.registers = ioremap(temp,128 * 4096); 994 intel_private.registers = ioremap(temp,128 * 4096);
993 if (!intel_private.registers) 995 if (!intel_private.registers) {
994 return -ENOMEM; 996 iounmap(intel_private.gtt);
997 return -ENOMEM;
998 }
995 999
996 temp = readl(intel_private.registers+I810_PGETBL_CTL) & 0xfffff000; 1000 temp = readl(intel_private.registers+I810_PGETBL_CTL) & 0xfffff000;
997 global_cache_flush(); /* FIXME: ? */ 1001 global_cache_flush(); /* FIXME: ? */