aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWen Yang <[email protected]>2019-03-23 14:14:31 +0800
committerMasahiro Yamada <[email protected]>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 <[email protected]> Signed-off-by: Wen Yang <[email protected]> Acked-by: Julia Lawall <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
-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 ...;
)