UPSTREAM: coccinelle: also catch kzfree() issues
authorYann Droneaud <ydroneaud@opteya.com>
Mon, 23 May 2016 15:07:19 +0000 (17:07 +0200)
committerHuang, Tao <huangtao@rock-chips.com>
Wed, 12 Jul 2017 13:17:10 +0000 (21:17 +0800)
commit8b5b2895d78243c02ab0d702cd2b289ee8e94379
treebeddf9b2e53aaefda9c42447cee7b1f7bde4c354
parent24b3eaac3a58df83dde048310994b4570d5ea3d8
UPSTREAM: coccinelle: also catch kzfree() issues

Since commit 3ef0e5ba4673 ('slab: introduce kzfree()'),
kfree() is no more the only function to be considered:
kzfree() should be recognized too.

In particular, kzfree() must not be called on memory
allocated through devm_*() functions.

Change-Id: I9cde2ad48245c628c6708ab008e0513945a04cef
Cc: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Yann Droneaud <ydroneaud@opteya.com>
Signed-off-by: Michal Marek <mmarek@suse.com>
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
(cherry picked from commit 6dd9379e8f327e70d182b15be3ba21aa2b5d2cba)
scripts/coccinelle/free/devm_free.cocci
scripts/coccinelle/free/ifnullfree.cocci
scripts/coccinelle/free/kfree.cocci
scripts/coccinelle/free/kfreeaddr.cocci