Skip to content

Commit

Permalink
pktcdvd: drop null test before destroy functions
Browse files Browse the repository at this point in the history
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]>
Signed-off-by: Jiri Kosina <[email protected]>
  • Loading branch information
JuliaLawall authored and Jiri Kosina committed Sep 29, 2015
1 parent e5f6450 commit 0220531
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/block/pktcdvd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2822,8 +2822,7 @@ static int pkt_setup_dev(dev_t dev, dev_t* pkt_dev)
out_mem2:
put_disk(disk);
out_mem:
if (pd->rb_pool)
mempool_destroy(pd->rb_pool);
mempool_destroy(pd->rb_pool);
kfree(pd);
out_mutex:
mutex_unlock(&ctl_mutex);
Expand Down

0 comments on commit 0220531

Please sign in to comment.