Skip to content

Commit

Permalink
thunderbolt: Remove a meaningless NULL pointer check before dma_pool_…
Browse files Browse the repository at this point in the history
…destroy

dma_pool_destroy() already takes NULL pointer into account so there is
no need to check that again in tb_ctl_free().

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
[mw: reword commit log a bit]
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
zhong jiang authored and Greg Kroah-Hartman committed Oct 2, 2018
1 parent 1856478 commit 0bb5a1a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/thunderbolt/ctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -662,8 +662,7 @@ void tb_ctl_free(struct tb_ctl *ctl)
tb_ctl_pkg_free(ctl->rx_packets[i]);


if (ctl->frame_pool)
dma_pool_destroy(ctl->frame_pool);
dma_pool_destroy(ctl->frame_pool);
kfree(ctl);
}

Expand Down

0 comments on commit 0bb5a1a

Please sign in to comment.