summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWen Yang <wen.yang99@zte.com.cn>2019-03-23 14:14:31 +0800
committerMasahiro Yamada <yamada.masahiro@socionext.com>2019-03-28 23:45:59 +0900
commit7265f5b72640f43e558af80347c62e32d568371f (patch)
treea73c895f860edb55e4266b24abcf3e0bc1208d8f
parent688931a5ad4e55ba0c215248ba510cd67bc3afb4 (diff)
coccinelle: put_device: reduce false positives
Don't complain about a return when this function returns "&pdev->dev". Fixes: da9cfb87a44d ("coccinelle: semantic code search for missing put_device()") Reported-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Wen Yang <wen.yang99@zte.com.cn> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
-rw-r--r--scripts/coccinelle/free/put_device.cocci1
1 files changed, 1 insertions, 0 deletions
diff --git a/scripts/coccinelle/free/put_device.cocci b/scripts/coccinelle/free/put_device.cocci
index 7395697e7f19..c9f071b0a0ab 100644
--- a/scripts/coccinelle/free/put_device.cocci
+++ b/scripts/coccinelle/free/put_device.cocci
@@ -32,6 +32,7 @@ if (id == NULL || ...) { ... return ...; }
( id
| (T2)dev_get_drvdata(&id->dev)
| (T3)platform_get_drvdata(id)
+| &id->dev
);
| return@p2 ...;
)