lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1407752653-16883-1-git-send-email-Julia.Lawall@lip6.fr>
Date:	Mon, 11 Aug 2014 12:24:13 +0200
From:	Julia Lawall <Julia.Lawall@...6.fr>
To:	Julia Lawall <Julia.Lawall@...6.fr>
Cc:	kernel-janitors@...r.kernel.org,
	Gilles Muller <Gilles.Muller@...6.fr>,
	Nicolas Palix <nicolas.palix@...g.fr>,
	Michal Marek <mmarek@...e.cz>, cocci@...teme.lip6.fr,
	linux-kernel@...r.kernel.org
Subject: [PATCH] scripts/coccinelle/free/ifnullfree.cocci: simplify and extend to of_node_put

From: Julia Lawall <Julia.Lawall@...6.fr>

Three changes:

* Don't remove and add function calls in the patch case
* Add of_node_put as a considered function
* Add a missing position variable on usb_free_urb

The need for the last change was spotted by SF Markus Elfring.

Signed-off-by: Julia Lawall <Julia.Lawall@...6.fr>

---
 scripts/coccinelle/free/ifnullfree.cocci |   17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/scripts/coccinelle/free/ifnullfree.cocci b/scripts/coccinelle/free/ifnullfree.cocci
index a42d70b..31be901 100644
--- a/scripts/coccinelle/free/ifnullfree.cocci
+++ b/scripts/coccinelle/free/ifnullfree.cocci
@@ -18,17 +18,15 @@ expression E;
 @@
 - if (E)
 (
--	kfree(E);
-+ kfree(E);
+	kfree(E);
 |
--	debugfs_remove(E);
-+ debugfs_remove(E);
+	debugfs_remove(E);
 |
--	debugfs_remove_recursive(E);
-+ debugfs_remove_recursive(E);
+	debugfs_remove_recursive(E);
 |
--	usb_free_urb(E);
-+ usb_free_urb(E);
+	usb_free_urb(E);
+|
+	of_node_put(E);
 )
 
 @r depends on context || report || org @
@@ -37,7 +35,8 @@ position p;
 @@
 
 * if (E)
-*	\(kfree@p\|debugfs_remove@p\|debugfs_remove_recursive@p\|usb_free_urb\)(E);
+*  \(kfree@p\|debugfs_remove@p\|debugfs_remove_recursive@p\|usb_free_urb@p\|
+*    of_node_put@p\)(E);
 
 @script:python depends on org@
 p << r.p;

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ