aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/rdma/ehca/ehca_mrmw.c
diff options
context:
space:
mode:
authorYash Shah <yshah1@visteon.com>2015-12-08 10:24:17 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-12-21 14:00:17 -0800
commit7438370a5150d6090957ab3e461d5b3a31f2181a (patch)
treeb474189e92ad6bb430162c515c31b9e599c04214 /drivers/staging/rdma/ehca/ehca_mrmw.c
parentstaging/rdma/hfi1: convert buffers allocated atomic to per cpu (diff)
downloadlinux-dev-7438370a5150d6090957ab3e461d5b3a31f2181a.tar.xz
linux-dev-7438370a5150d6090957ab3e461d5b3a31f2181a.zip
Staging: rdma:Delete unnecessary NULL check before calling function "kmem_cache_destroy"
The kmem_cache_destroy() function tests whether its argument is NULL and then returns immediately. Thus the NULL check before calling this function is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Yash Shah <yshah1@visteon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rdma/ehca/ehca_mrmw.c')
-rw-r--r--drivers/staging/rdma/ehca/ehca_mrmw.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/staging/rdma/ehca/ehca_mrmw.c b/drivers/staging/rdma/ehca/ehca_mrmw.c
index f914b30999f8..553e883a5718 100644
--- a/drivers/staging/rdma/ehca/ehca_mrmw.c
+++ b/drivers/staging/rdma/ehca/ehca_mrmw.c
@@ -2251,10 +2251,8 @@ int ehca_init_mrmw_cache(void)
void ehca_cleanup_mrmw_cache(void)
{
- if (mr_cache)
- kmem_cache_destroy(mr_cache);
- if (mw_cache)
- kmem_cache_destroy(mw_cache);
+ kmem_cache_destroy(mr_cache);
+ kmem_cache_destroy(mw_cache);
}
static inline int ehca_init_top_bmap(struct ehca_top_bmap *ehca_top_bmap,