Merge branch 'agp-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/agp-2.6

* 'agp-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/agp-2.6:
agp/hp: fail gracefully if we don't find an IOC
agp/hp: fixup hp agp after ACPI changes
agp: correct missing cleanup on error in agp_add_bridge

+13 -6
+9 -4
drivers/char/agp/backend.c
··· 285 285 { 286 286 int error; 287 287 288 - if (agp_off) 289 - return -ENODEV; 288 + if (agp_off) { 289 + error = -ENODEV; 290 + goto err_put_bridge; 291 + } 290 292 291 293 if (!bridge->dev) { 292 294 printk (KERN_DEBUG PFX "Erk, registering with no pci_dev!\n"); 293 - return -EINVAL; 295 + error = -EINVAL; 296 + goto err_put_bridge; 294 297 } 295 298 296 299 /* Grab reference on the chipset driver. */ 297 300 if (!try_module_get(bridge->driver->owner)) { 298 301 dev_info(&bridge->dev->dev, "can't lock chipset driver\n"); 299 - return -EINVAL; 302 + error = -EINVAL; 303 + goto err_put_bridge; 300 304 } 301 305 302 306 error = agp_backend_initialize(bridge); ··· 330 326 agp_backend_cleanup(bridge); 331 327 err_out: 332 328 module_put(bridge->driver->owner); 329 + err_put_bridge: 333 330 agp_put_bridge(bridge); 334 331 return error; 335 332 }
+4 -2
drivers/char/agp/hp-agp.c
··· 488 488 handle = obj; 489 489 do { 490 490 status = acpi_get_object_info(handle, &info); 491 - if (ACPI_SUCCESS(status)) { 491 + if (ACPI_SUCCESS(status) && (info->valid & ACPI_VALID_HID)) { 492 492 /* TBD check _CID also */ 493 - info->hardware_id.string[sizeof(info->hardware_id.length)-1] = '\0'; 494 493 match = (strcmp(info->hardware_id.string, "HWP0001") == 0); 495 494 kfree(info); 496 495 if (match) { ··· 507 508 status = acpi_get_parent(handle, &parent); 508 509 handle = parent; 509 510 } while (ACPI_SUCCESS(status)); 511 + 512 + if (ACPI_FAILURE(status)) 513 + return AE_OK; /* found no enclosing IOC */ 510 514 511 515 if (hp_zx1_setup(sba_hpa + HP_ZX1_IOC_OFFSET, lba_hpa)) 512 516 return AE_OK;