Skip to contentSkip to conversation

coccinelle: api/kstrdup: fix coccinelle position

PATCH In review Denis Efremov 2 participants 2 messages Jun 19, 2020 Coccinelle/Semantic Patches (SmPL)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 coccinelle: api/kstrdup: fix coccinelle position

There is a typo in rule r2. Position p1 should be attached to kzalloc() call.

Fixes 29a36d4dec6c ("scripts/coccinelle: improve the coverage of some semantic patches")
---
 scripts/coccinelle/api/kstrdup.cocci | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/coccinelle/api/kstrdup.cocci +1 -1
index 19f2645e6076..3c6dc5469ee4 100644
@@ -66,7 +66,7 @@ position p1,p2;
 
 *   x = strlen(from) + 1;
     ... when != \( x = E1 \| from = E1 \)
-*   to = \(kmalloc@p1\|kzalloc@p2\)(x,flag);
+*   to = \(kmalloc@p1\|kzalloc@p1\)(x,flag);
     ... when != \(x = E2 \| from = E2 \| to = E2 \)
     if (to==NULL || ...) S
     ... when != \(x = E3 \| from = E3 \| to = E3 \)
Signature · 1 line
2.26.2
maintainer
#1 lore raw
Quoted 2 lines · Denis Efremov

There is a typo in rule r2. Position p1 should be attached to kzalloc() call.

Clearly. Thanks. Applied.

julia

Quoted 28 lines
Fixes 29a36d4dec6c ("scripts/coccinelle: improve the coverage of some semantic patches")
---
 scripts/coccinelle/api/kstrdup.cocci | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/coccinelle/api/kstrdup.cocci +1 -2
index 19f2645e6076..3c6dc5469ee4 100644
@@ -66,7 +66,7 @@ position p1,p2;
 
 *   x = strlen(from) + 1;
     ... when != \( x = E1 \| from = E1 \)
-*   to = \(kmalloc@p1\|kzalloc@p2\)(x,flag);
+*   to = \(kmalloc@p1\|kzalloc@p1\)(x,flag);
     ... when != \(x = E2 \| from = E2 \| to = E2 \)
     if (to==NULL || ...) S
     ... when != \(x = E3 \| from = E3 \| to = E3 \)
--

2.26.2

_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci