The patch titled hpet: clean up io mapping when hpet_alloc() fails has been added to the -mm tree. Its filename is hpet-clean-up-io-mapping-when-hpet_alloc-fails.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: hpet: clean up io mapping when hpet_alloc() fails From: Bjorn Helgaas <bjorn.helgaas@xxxxxx> When hpet_alloc() fails, we should iounmap() the timer so we don't leak the mapping. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@xxxxxx> Cc: Venkatesh Pallipadi <venki@xxxxxxxxxx> Cc: Clemens Ladisch <clemens@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/char/hpet.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff -puN drivers/char/hpet.c~hpet-clean-up-io-mapping-when-hpet_alloc-fails drivers/char/hpet.c --- a/drivers/char/hpet.c~hpet-clean-up-io-mapping-when-hpet_alloc-fails +++ a/drivers/char/hpet.c @@ -949,7 +949,7 @@ static int hpet_pnp_add(struct pnp_dev * { struct hpet_data data; struct resource *mem, *irq; - int i; + int i, ret; memset(&data, 0, sizeof(data)); @@ -969,7 +969,11 @@ static int hpet_pnp_add(struct pnp_dev * data.hd_phys_address = mem->start; data.hd_address = ioremap(mem->start, resource_size(mem)); - return hpet_alloc(&data); + ret = hpet_alloc(&data); + if (ret) + iounmap(data.hd_address); + + return ret; } static void hpet_pnp_remove(struct pnp_dev *dev) _ Patches currently in -mm which might be from bjorn.helgaas@xxxxxx are linux-next.patch hpet-convert-from-acpi-to-pnp-driver.patch hpet-pass-physical-address-not-entire-hpet_data-to-hpet_is_known.patch hpet-clean-up-io-mapping-when-hpet_alloc-fails.patch maintainers-remove-obsolete-hpet-acpi-entry.patch ipmi-raise-precedence-of-pnp-based-discovery-mechanisms-acpi-pci.patch ipmi-convert-tracking-of-the-acpi-device-pointer-to-a-pnp-device.patch ipmi-update-driver-to-use-dev_printk-and-its-constructs.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html