Skip to content

coccinelle: catchup on memory allocation functions

Yann Droneaud cocci lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 6 repliesIn review
  2. v13 patches 8 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3coccinelle: also catch kzfree() issuesscripts/coccinelle/free/devm_free.cocci scripts/coccinelle/free/ifnullfree.cocci scripts/coccinelle/free/kfree.cocci +1 more+25 -56 replies
2/3coccinelle: recognize more devm_* memory allocation functionsscripts/coccinelle/free/devm_free.cocci+20 -00 replies
3/3coccinelle: catch krealloc() on devm_*() allocated memoryscripts/coccinelle/free/devm_free.cocci+4 -00 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchJulia Lawall
1/3A-b
2/3A-b
3/3A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/3] coccinelle: catchup on memory allocation functions

Hi,

Please find updated patches that remove coccicheck's blindness regarding the following functions:
- kzfree()
- krealloc()
- __krealloc()
- devm_kmalloc()
- devm_kvasprintf()
- devm_kasprintf()
- devm_kmalloc_array()
- devm_kcalloc()
- devm_kstrdup()
- devm_kmemdup()
- devm_get_free_pages()
- free_pages()
- free_page()

Changes since v1 [1]:
- add kzfree() to ifnullfree.cocci
- added acked-by

(note: v1 was a single patch update to v0)

Changes since v0 [2]:
- don't use regular expression in kfree.cocci

[1] http://lkml.kernel.org/r/1456150168-24028-1-git-send-email-ydroneaud at opteya.com
[2] http://lkml.kernel.org/r/cover.1455638829.git.ydroneaud at opteya.com

Regards.

Yann Droneaud (3):
coccinelle: also catch kzfree() issues
coccinelle: recognize more devm_* memory allocation functions
coccinelle: catch krealloc() on devm_*() allocated memory

 scripts/coccinelle/free/devm_free.cocci  | 26 ++++++++++++++++++++++++++
 scripts/coccinelle/free/ifnullfree.cocci |  4 +++-
 scripts/coccinelle/free/kfree.cocci      | 18 +++++++++++++++---
 scripts/coccinelle/free/kfreeaddr.cocci  |  6 +++++-
 4 files changed, 49 insertions(+), 5 deletions(-)
Signature · 1 line
2.7.4