Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1a1d92c1 authored by Alexey Dobriyan's avatar Alexey Dobriyan Committed by Linus Torvalds
Browse files

[PATCH] Really ignore kmem_cache_destroy return value



* Rougly half of callers already do it by not checking return value
* Code in drivers/acpi/osl.c does the following to be sure:

	(void)kmem_cache_destroy(cache);

* Those who check it printk something, however, slab_error already printed
  the name of failed cache.
* XFS BUGs on failed kmem_cache_destroy which is not the decision
  low-level filesystem driver should make. Converted to ignore.

Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent f52720ca
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1079,7 +1079,7 @@ acpi_status acpi_os_purge_cache(acpi_cache_t * cache)

acpi_status acpi_os_delete_cache(acpi_cache_t * cache)
{
	(void)kmem_cache_destroy(cache);
	kmem_cache_destroy(cache);
	return (AE_OK);
}

+1 −4
Original line number Diff line number Diff line
@@ -2987,10 +2987,7 @@ static int __init ib_mad_init_module(void)
static void __exit ib_mad_cleanup_module(void)
{
	ib_unregister_client(&mad_client);

	if (kmem_cache_destroy(ib_mad_cache)) {
		printk(KERN_DEBUG PFX "Failed to destroy ib_mad cache\n");
	}
	kmem_cache_destroy(ib_mad_cache);
}

module_init(ib_mad_init_module);
+2 −6
Original line number Diff line number Diff line
@@ -913,8 +913,7 @@ static int __init uhci_hcd_init(void)
	return 0;

init_failed:
	if (kmem_cache_destroy(uhci_up_cachep))
		warn("not all urb_privs were freed!");
	kmem_cache_destroy(uhci_up_cachep);

up_failed:
	debugfs_remove(uhci_debugfs_root);
@@ -930,10 +929,7 @@ static int __init uhci_hcd_init(void)
static void __exit uhci_hcd_cleanup(void) 
{
	pci_unregister_driver(&uhci_pci_driver);
	
	if (kmem_cache_destroy(uhci_up_cachep))
		warn("not all urb_privs were freed!");

	kmem_cache_destroy(uhci_up_cachep);
	debugfs_remove(uhci_debugfs_root);
	kfree(errbuf);
}
+1 −2
Original line number Diff line number Diff line
@@ -251,8 +251,7 @@ static int init_inodecache(void)

static void destroy_inodecache(void)
{
	if (kmem_cache_destroy(adfs_inode_cachep))
		printk(KERN_INFO "adfs_inode_cache: not all structures were freed\n");
	kmem_cache_destroy(adfs_inode_cachep);
}

static struct super_operations adfs_sops = {
+1 −2
Original line number Diff line number Diff line
@@ -109,8 +109,7 @@ static int init_inodecache(void)

static void destroy_inodecache(void)
{
	if (kmem_cache_destroy(affs_inode_cachep))
		printk(KERN_INFO "affs_inode_cache: not all structures were freed\n");
	kmem_cache_destroy(affs_inode_cachep);
}

static struct super_operations affs_sops = {
Loading