From 7438370a5150d6090957ab3e461d5b3a31f2181a Mon Sep 17 00:00:00 2001 From: Yash Shah Date: Tue, 8 Dec 2015 10:24:17 +0000 Subject: 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 Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rdma/ehca/ehca_mrmw.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/staging/rdma/ehca/ehca_mrmw.c') 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, -- cgit v1.2.3-59-g8ed1b