diff options
| author | Alexey Dobriyan <adobriyan@gmail.com> | 2006-09-27 04:49:40 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-27 11:26:10 -0400 |
| commit | 1a1d92c10dd24bbdc28b3d6e2d03ec199dd3a65b (patch) | |
| tree | fade83955f75e718e39153d6f81d221403338bed | |
| parent | f52720ca5f48574e347dff35ffe6b389ace61537 (diff) | |
[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: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
40 files changed, 53 insertions, 130 deletions
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 507f051d1cef..20beea778ea2 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c | |||
| @@ -1079,7 +1079,7 @@ acpi_status acpi_os_purge_cache(acpi_cache_t * cache) | |||
| 1079 | 1079 | ||
| 1080 | acpi_status acpi_os_delete_cache(acpi_cache_t * cache) | 1080 | acpi_status acpi_os_delete_cache(acpi_cache_t * cache) |
| 1081 | { | 1081 | { |
| 1082 | (void)kmem_cache_destroy(cache); | 1082 | kmem_cache_destroy(cache); |
| 1083 | return (AE_OK); | 1083 | return (AE_OK); |
| 1084 | } | 1084 | } |
| 1085 | 1085 | ||
diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c index 082f03c158f0..493f4c65c7a2 100644 --- a/drivers/infiniband/core/mad.c +++ b/drivers/infiniband/core/mad.c | |||
| @@ -2987,10 +2987,7 @@ error1: | |||
| 2987 | static void __exit ib_mad_cleanup_module(void) | 2987 | static void __exit ib_mad_cleanup_module(void) |
| 2988 | { | 2988 | { |
| 2989 | ib_unregister_client(&mad_client); | 2989 | ib_unregister_client(&mad_client); |
| 2990 | 2990 | kmem_cache_destroy(ib_mad_cache); | |
| 2991 | if (kmem_cache_destroy(ib_mad_cache)) { | ||
| 2992 | printk(KERN_DEBUG PFX "Failed to destroy ib_mad cache\n"); | ||
| 2993 | } | ||
| 2994 | } | 2991 | } |
| 2995 | 2992 | ||
| 2996 | module_init(ib_mad_init_module); | 2993 | module_init(ib_mad_init_module); |
diff --git a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c index b7402ceb3e93..eb4eab98e8bf 100644 --- a/drivers/usb/host/uhci-hcd.c +++ b/drivers/usb/host/uhci-hcd.c | |||
| @@ -913,8 +913,7 @@ static int __init uhci_hcd_init(void) | |||
| 913 | return 0; | 913 | return 0; |
| 914 | 914 | ||
| 915 | init_failed: | 915 | init_failed: |
| 916 | if (kmem_cache_destroy(uhci_up_cachep)) | 916 | kmem_cache_destroy(uhci_up_cachep); |
| 917 | warn("not all urb_privs were freed!"); | ||
| 918 | 917 | ||
| 919 | up_failed: | 918 | up_failed: |
| 920 | debugfs_remove(uhci_debugfs_root); | 919 | debugfs_remove(uhci_debugfs_root); |
| @@ -930,10 +929,7 @@ errbuf_failed: | |||
| 930 | static void __exit uhci_hcd_cleanup(void) | 929 | static void __exit uhci_hcd_cleanup(void) |
| 931 | { | 930 | { |
| 932 | pci_unregister_driver(&uhci_pci_driver); | 931 | pci_unregister_driver(&uhci_pci_driver); |
| 933 | 932 | kmem_cache_destroy(uhci_up_cachep); | |
| 934 | if (kmem_cache_destroy(uhci_up_cachep)) | ||
| 935 | warn("not all urb_privs were freed!"); | ||
| 936 | |||
| 937 | debugfs_remove(uhci_debugfs_root); | 933 | debugfs_remove(uhci_debugfs_root); |
| 938 | kfree(errbuf); | 934 | kfree(errbuf); |
| 939 | } | 935 | } |
diff --git a/fs/adfs/super.c b/fs/adfs/super.c index 959dbf1f8e63..9ade139086fc 100644 --- a/fs/adfs/super.c +++ b/fs/adfs/super.c | |||
| @@ -251,8 +251,7 @@ static int init_inodecache(void) | |||
| 251 | 251 | ||
| 252 | static void destroy_inodecache(void) | 252 | static void destroy_inodecache(void) |
| 253 | { | 253 | { |
| 254 | if (kmem_cache_destroy(adfs_inode_cachep)) | 254 | kmem_cache_destroy(adfs_inode_cachep); |
| 255 | printk(KERN_INFO "adfs_inode_cache: not all structures were freed\n"); | ||
| 256 | } | 255 | } |
| 257 | 256 | ||
| 258 | static struct super_operations adfs_sops = { | 257 | static struct super_operations adfs_sops = { |
diff --git a/fs/affs/super.c b/fs/affs/super.c index b35f514479bf..5ea72c3a16c3 100644 --- a/fs/affs/super.c +++ b/fs/affs/super.c | |||
| @@ -109,8 +109,7 @@ static int init_inodecache(void) | |||
| 109 | 109 | ||
| 110 | static void destroy_inodecache(void) | 110 | static void destroy_inodecache(void) |
| 111 | { | 111 | { |
| 112 | if (kmem_cache_destroy(affs_inode_cachep)) | 112 | kmem_cache_destroy(affs_inode_cachep); |
| 113 | printk(KERN_INFO "affs_inode_cache: not all structures were freed\n"); | ||
| 114 | } | 113 | } |
| 115 | 114 | ||
| 116 | static struct super_operations affs_sops = { | 115 | static struct super_operations affs_sops = { |
diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c index 50cfca5c7efd..f6676fbe9484 100644 --- a/fs/befs/linuxvfs.c +++ b/fs/befs/linuxvfs.c | |||
| @@ -446,9 +446,7 @@ befs_init_inodecache(void) | |||
| 446 | static void | 446 | static void |
| 447 | befs_destroy_inodecache(void) | 447 | befs_destroy_inodecache(void) |
| 448 | { | 448 | { |
| 449 | if (kmem_cache_destroy(befs_inode_cachep)) | 449 | kmem_cache_destroy(befs_inode_cachep); |
| 450 | printk(KERN_ERR "befs_destroy_inodecache: " | ||
| 451 | "not all structures were freed\n"); | ||
| 452 | } | 450 | } |
| 453 | 451 | ||
| 454 | /* | 452 | /* |
diff --git a/fs/bfs/inode.c b/fs/bfs/inode.c index 3e4d6c767b9b..8fc2e8e49dbe 100644 --- a/fs/bfs/inode.c +++ b/fs/bfs/inode.c | |||
| @@ -268,8 +268,7 @@ static int init_inodecache(void) | |||
| 268 | 268 | ||
| 269 | static void destroy_inodecache(void) | 269 | static void destroy_inodecache(void) |
| 270 | { | 270 | { |
| 271 | if (kmem_cache_destroy(bfs_inode_cachep)) | 271 | kmem_cache_destroy(bfs_inode_cachep); |
| 272 | printk(KERN_INFO "bfs_inode_cache: not all structures were freed\n"); | ||
| 273 | } | 272 | } |
| 274 | 273 | ||
| 275 | static struct super_operations bfs_sops = { | 274 | static struct super_operations bfs_sops = { |
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index c3ef1c0d0e68..4197a5043f13 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c | |||
| @@ -699,8 +699,7 @@ cifs_init_inodecache(void) | |||
| 699 | static void | 699 | static void |
| 700 | cifs_destroy_inodecache(void) | 700 | cifs_destroy_inodecache(void) |
| 701 | { | 701 | { |
| 702 | if (kmem_cache_destroy(cifs_inode_cachep)) | 702 | kmem_cache_destroy(cifs_inode_cachep); |
| 703 | printk(KERN_WARNING "cifs_inode_cache: error freeing\n"); | ||
| 704 | } | 703 | } |
| 705 | 704 | ||
| 706 | static int | 705 | static int |
| @@ -778,13 +777,9 @@ static void | |||
| 778 | cifs_destroy_request_bufs(void) | 777 | cifs_destroy_request_bufs(void) |
| 779 | { | 778 | { |
| 780 | mempool_destroy(cifs_req_poolp); | 779 | mempool_destroy(cifs_req_poolp); |
| 781 | if (kmem_cache_destroy(cifs_req_cachep)) | 780 | kmem_cache_destroy(cifs_req_cachep); |
| 782 | printk(KERN_WARNING | ||
| 783 | "cifs_destroy_request_cache: error not all structures were freed\n"); | ||
| 784 | mempool_destroy(cifs_sm_req_poolp); | 781 | mempool_destroy(cifs_sm_req_poolp); |
| 785 | if (kmem_cache_destroy(cifs_sm_req_cachep)) | 782 | kmem_cache_destroy(cifs_sm_req_cachep); |
| 786 | printk(KERN_WARNING | ||
| 787 | "cifs_destroy_request_cache: cifs_small_rq free error\n"); | ||
