hfi1: drop null test before destroy functions
authorJulia Lawall <[email protected]>
Sun, 13 Sep 2015 12:15:04 +0000 (14:15 +0200)
committerGreg Kroah-Hartman <[email protected]>
Tue, 15 Sep 2015 13:40:57 +0000 (06:40 -0700)
Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <[email protected]>
Cc: Mike Marciniszyn <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
drivers/staging/rdma/hfi1/user_sdma.c

index 55526613a522a794c17591cf5040883fae19046d..66202625a58c602f9bcf35affb9252269411a3f7 100644 (file)
@@ -486,8 +486,7 @@ int hfi1_user_sdma_free_queues(struct hfi1_filedata *fd)
                        }
                        kfree(pq->reqs);
                }
-               if (pq->txreq_cache)
-                       kmem_cache_destroy(pq->txreq_cache);
+               kmem_cache_destroy(pq->txreq_cache);
                kfree(pq);
                fd->pq = NULL;
        }