Skip to content

Commit

Permalink
UBI: 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 <Julia.Lawall@lip6.fr>
Signed-off-by: Richard Weinberger <richard@nod.at>
  • Loading branch information
Julia Lawall authored and Richard Weinberger committed Oct 3, 2015
1 parent 86f6e45 commit f9a113d
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/mtd/ubi/attach.c
Original file line number Diff line number Diff line change
Expand Up @@ -1209,9 +1209,7 @@ static void destroy_ai(struct ubi_attach_info *ai)
}
}

if (ai->aeb_slab_cache)
kmem_cache_destroy(ai->aeb_slab_cache);

kmem_cache_destroy(ai->aeb_slab_cache);
kfree(ai);
}

Expand Down

0 comments on commit f9a113d

Please sign in to comment.