From b348c75de7cc21e12f278250412e7b9ac49f2712 Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Mon, 9 Jun 2014 22:32:13 +0200 Subject: [PATCH] unlock_return.cocci: Add vn_unlock() and wlan_serialize_exit() tests. --- test/cocci/unlock_return.cocci | 53 +++++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/test/cocci/unlock_return.cocci b/test/cocci/unlock_return.cocci index 7274382d2b..beaf448153 100644 --- a/test/cocci/unlock_return.cocci +++ b/test/cocci/unlock_return.cocci @@ -1,10 +1,11 @@ // // Look for missing lock releases before returning from an error path. // -// Target: Linux +// Target: DragonFly // Copyright: 2012 - LIP6/INRIA // License: Licensed under ISC. See LICENSE or http://www.isc.org/software/license // Author: Julia Lawall +// (original code, adapted for DragonFly by swildner) // URL: http://coccinelle.lip6.fr/ // URL: http://coccinellery.org/ // @@ -156,3 +157,53 @@ expression E; *vm_object_hold@p1(E); ... when != vm_object_drop(E); ?*return ...; + +// vn_lock(...) / vn_unlock(...) +// +@rcu_vn_lock exists@ +position p1; +expression E; +@@ + +( +vn_lock@p1(E,...); +| +vget@p1(E); +) +... +( +vn_unlock(E); +| +vput(E); +) + +@exists@ +position rcu_vn_lock.p1; +expression E; +@@ + +( +*vn_lock@p1(E,...); +| +*vget@p1(E); +) +... when != \(vn_unlock\|vput\)(E); +?*return ...; + +// wlan_serialize_enter(...) / wlan_serialize_exit(...) +// +@rcu_wlan_serialize_enter exists@ +position p1; +@@ + +wlan_serialize_enter@p1(); +... +wlan_serialize_exit(); + +@exists@ +position rcu_wlan_serialize_enter.p1; +@@ + +*wlan_serialize_enter@p1(); +... when != wlan_serialize_exit(); +?*return ...; -- 2.41.0