netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net/rds: Remove unnecessary null check
@ 2019-10-15 11:47 YueHaibing
  2019-10-17 19:24 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: YueHaibing @ 2019-10-15 11:47 UTC (permalink / raw)
  To: santosh.shilimkar, davem
  Cc: netdev, linux-rdma, rds-devel, linux-kernel, YueHaibing

Null check before dma_pool_destroy is redundant, so remove it.
This is detected by coccinelle.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 net/rds/ib.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/rds/ib.c b/net/rds/ib.c
index 62d4ebe..3fd5f40 100644
--- a/net/rds/ib.c
+++ b/net/rds/ib.c
@@ -108,8 +108,7 @@ static void rds_ib_dev_free(struct work_struct *work)
 		rds_ib_destroy_mr_pool(rds_ibdev->mr_1m_pool);
 	if (rds_ibdev->pd)
 		ib_dealloc_pd(rds_ibdev->pd);
-	if (rds_ibdev->rid_hdrs_pool)
-		dma_pool_destroy(rds_ibdev->rid_hdrs_pool);
+	dma_pool_destroy(rds_ibdev->rid_hdrs_pool);
 
 	list_for_each_entry_safe(i_ipaddr, i_next, &rds_ibdev->ipaddr_list, list) {
 		list_del(&i_ipaddr->list);
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] net/rds: Remove unnecessary null check
  2019-10-15 11:47 [PATCH net-next] net/rds: Remove unnecessary null check YueHaibing
@ 2019-10-17 19:24 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-10-17 19:24 UTC (permalink / raw)
  To: yuehaibing; +Cc: santosh.shilimkar, netdev, linux-rdma, rds-devel, linux-kernel

From: YueHaibing <yuehaibing@huawei.com>
Date: Tue, 15 Oct 2019 19:47:36 +0800

> Null check before dma_pool_destroy is redundant, so remove it.
> This is detected by coccinelle.
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-10-17 19:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-15 11:47 [PATCH net-next] net/rds: Remove unnecessary null check YueHaibing
2019-10-17 19:24 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).