Category: Linux

ipv6: Remove some pointless conditionals before kfree_skb()

Author: Wei Yongjun <yjwei@cn.fujitsu.com> Remove some pointless conditionals before kfree_skb(). The semantic match that finds the problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // @@ expression E; @@ – if (E) – kfree_skb(E); + kfree_skb(E); // Signed-off-by: Wei Yongjun Signed-off-by: David S. Miller — net/ipv6/ipv6_sockglue.c | 3 +– net/ipv6/tcp_ipv6.c | 6 ++—- 2 files changed, 3 insertions(+), …

Continue reading

UBIFS: list usage cleanup

Author: Eric Sesterhenn <snakebyte@gmx.de> Trivial cleanup, list_del(); list_add{,_tail}() is equivalent to list_move{,_tail}(). Semantic patch for coccinelle can be found at www.cccmz.de/~snakebyte/list_move_tail.spatch Signed-off-by: Eric Sesterhenn Signed-off-by: Artem Bityutskiy — fs/ubifs/log.c | 3 +– fs/ubifs/shrinker.c | 6 ++—- 2 files changed, 3 insertions(+), 6 deletions(-)   diff –git a/fs/ubifs/log.c b/fs/ubifs/log.c index 3e0aa73..1004261 100644 — a/fs/ubifs/log.c +++ b/fs/ubifs/log.c …

Continue reading

Btrfs: fs/btrfs/volumes.c: remove useless kzalloc

Author: Julia Lawall <julia@diku.dk> The call to kzalloc is followed by a kmalloc whose result is stored in the same variable. The semantic match that finds the problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // @r exists@ local idexpression x; statement S; expression E; identifier f,l; position p1,p2; expression *ptr != NULL; @@ ( if ((x@p1 = …

Continue reading

Staging: et131x: list usage cleanup

Author: Eric Sesterhenn <snakebyte@gmx.de> Trivial cleanup, list_del(); list_add_tail() is equivalent to list_move_tail(). Semantic patch for coccinelle can be found at www.cccmz.de/~snakebyte/list_move_tail.spatch Signed-off-by: Eric Sesterhenn Signed-off-by: Greg Kroah-Hartman — drivers/staging/et131x/et1310_rx.c | 3 +– 1 file changed, 1 insertion(+), 2 deletions(-)   diff –git a/drivers/staging/et131x/et1310_rx.c b/drivers/staging/et131x/et1310_rx.c index ec98da5..8dc559a 100644 — a/drivers/staging/et131x/et1310_rx.c +++ b/drivers/staging/et131x/et1310_rx.c @@ -1203,8 +1203,7 @@ …

Continue reading

drivers/isdn: introduce missing kfree

Author: Julia Lawall <julia@diku.dk> Error handling code following a kmalloc should free the allocated data. The semantic match that finds the problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // @r exists@ local idexpression x; statement S; expression E; identifier f,l; position p1,p2; expression *ptr != NULL; @@ ( if ((x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(…)) == NULL) S | x@p1 …

Continue reading

drivers/atm: introduce missing kfree

Author: Julia Lawall <julia@diku.dk> Error handling code following a kmalloc should free the allocated data. The semantic match that finds the problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // @r exists@ local idexpression x; statement S; expression E; identifier f,l; position p1,p2; expression *ptr != NULL; @@ ( if ((x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(…)) == NULL) S | x@p1 …

Continue reading

PCI: introduce missing kfree

Author: Julia Lawall <julia@diku.dk> Error handling code following a kmalloc should free the allocated data. Since the subsequent code that could provoke an error does not use the allocated data, the allocation is just moved below it. The semantic match that finds the problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // @r exists@ local idexpression x; statement …

Continue reading

[SCSI] lpfc: introduce missing kfree

Author: Julia Lawall <julia@diku.dk> Error handling code following a kmalloc should free the allocated data. The semantic match that finds the problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // @r exists@ local idexpression x; statement S; expression E; identifier f,l; position p1,p2; expression *ptr != NULL; @@ ( if ((x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(…)) == NULL) S | x@p1 …

Continue reading

arch/powerpc: Eliminate double sizeof

Author: Julia Lawall <julia@diku.dk> Taking sizeof the result of sizeof is quite strange and does not seem to be what is wanted here. This was fixed using the following semantic patch. (http://www.emn.fr/x-info/coccinelle/) // @@ expression E; @@ – sizeof ( sizeof (E) – ) @@ type T; @@ – sizeof ( sizeof (T) – ) …

Continue reading

[SCSI] libfc: Correct use of ! and &

Author: Julia Lawall <julia@diku.dk> !ep->esb_stat is either 1 or 0, and the rightmost bit of ESB_ST_COMPLETE is always 0, making the result of !ep->esb_stat & ESB_ST_COMPLETE always 0. Thus parentheses around the argument to ! seem needed. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @@ expression E; constant C; @@ …

Continue reading