Author: Julia Lawall <Julia.Lawall@lip6.fr> Use devm_kzalloc for all calls to kzalloc and not just the first. Use devm functions for other allocations as well. Move the call to platform_get_resource(pdev, IORESOURCE_MEM, 0) closer to where its result is passed to devm_request_and_ioremap to make the lack of need for a NULL test more evident. The semantic match …
Aug 04 2012
drivers/pinctrl/pinctrl-nomadik.c: drop devm_kfree of devm_kzalloc’d data
Author: Julia Lawall <Julia.Lawall@lip6.fr> devm_kfree should not have to be explicitly used. The semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression x,d; @@ x = devm_kzalloc(…) … ?-devm_kfree(d,x); // Signed-off-by: Julia Lawall Signed-off-by: Linus Walleij — drivers/pinctrl/pinctrl-nomadik.c | 1 – 1 file changed, 1 deletion(-) diff –git a/drivers/pinctrl/pinctrl-nomadik.c b/drivers/pinctrl/pinctrl-nomadik.c …
Aug 04 2012
drivers/char/hw_random/octeon-rng.c: drop frees of devm allocated data
Author: Julia Lawall <Julia.Lawall@lip6.fr> devm_kfree and devm_iounmap should not have to be explicitly used. The semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression x,d; @@ x = devm_kzalloc(…) … ?-devm_kfree(d,x); // Signed-off-by: Julia Lawall Signed-off-by: Herbert Xu — drivers/char/hw_random/octeon-rng.c | 17 +++++———— 1 file changed, 5 insertions(+), 12 deletions(-) …
Aug 04 2012
mfd: palmas: Drop kfree of devm_kzalloc’s data
Author: Julia Lawall <Julia.Lawall@lip6.fr> Using kfree to free data allocated with devm_kzalloc causes double frees. The semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression x; @@ x = devm_kzalloc(…) … ?-kfree(x); // Signed-off-by: Julia Lawall Signed-off-by: Samuel Ortiz — drivers/mfd/palmas.c | 1 – 1 file changed, 1 deletion(-) diff …
Aug 04 2012
drivers/video/auo_k190x.c: drop kfree of devm_kzalloc’s data
Author: Julia Lawall <Julia.Lawall@lip6.fr> Using kfree to free data allocated with devm_kzalloc causes double frees. The semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression x; @@ x = devm_kzalloc(…) … ?-kfree(x); // Signed-off-by: Julia Lawall Signed-off-by: Florian Tobias Schandinat — drivers/video/auo_k190x.c | 2 — 1 file changed, 2 deletions(-) …
Aug 04 2012
drivers/dma/sirf-dma.c: fix usage of devm functions
Author: Julia Lawall <Julia.Lawall@lip6.fr> Fix some problems with the use of devm_ functions. devm_kzalloc: devm_kfree is not needed devm_ioremap: iounmap should not be used, no free is needed devm_request_irq: the devm_free_irq is followed by irq_dispose_mapping. I don’t know if it is safe to move the freeing of the irq in this case, so I have …
Aug 04 2012
btrfs: fix second lock in btrfs_delete_delayed_items()
Author: Fengguang Wu <fengguang.wu@intel.com> Fix a real bug caught by coccinelle. fs/btrfs/delayed-inode.c:1013:1-11: second lock on line 1013 Signed-off-by: Fengguang Wu — fs/btrfs/delayed-inode.c | 5 +++– 1 file changed, 3 insertions(+), 2 deletions(-) diff –git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c index 335605c..00deed4e 100644 — a/fs/btrfs/delayed-inode.c +++ b/fs/btrfs/delayed-inode.c @@ -1028,9 +1028,10 @@ do_again: btrfs_release_delayed_item(prev); ret = 0; btrfs_release_path(path); – …
Aug 04 2012
drivers/net/phy/mdio-mux-gpio.c: drop devm_kfree of devm_kzalloc’d data
Author: Julia Lawall <Julia.Lawall@lip6.fr> devm_kfree should not have to be explicitly used. The semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression x,d; @@ x = devm_kzalloc(…) … ?-devm_kfree(d,x); // Signed-off-by: Julia Lawall Signed-off-by: David S. Miller — drivers/net/phy/mdio-mux-gpio.c | 1 – 1 file changed, 1 deletion(-) diff –git a/drivers/net/phy/mdio-mux-gpio.c …
Jul 31 2012
tcm_vhost: Fix incorrect IS_ERR() usage in vhost_scsi_map_iov_to_sgl
Author: Fengguang Wu <fengguang.wu@intel.com> Fix up a new coccinelle warnings reported by Fengguang Wu + Intel 0-DAY kernel build testing backend: drivers/vhost/tcm_vhost.c:537:23-29: ERROR: allocation function on line 533 returns NULL not ERR_PTR on failure vim +537 drivers/vhost/tcm_vhost.c 534 if (!sg) 535 return -ENOMEM; 536 pr_debug(“%s sg %p sgl_count %u is_err %ld\n”, __func__, > 537 sg, …
Jul 28 2012
netfilter: PTR_RET can be used
Author: Wu Fengguang <fengguang.wu@intel.com> This quiets the coccinelle warnings: net/bridge/netfilter/ebtable_filter.c:107:1-3: WARNING: PTR_RET can be used net/bridge/netfilter/ebtable_nat.c:107:1-3: WARNING: PTR_RET can be used net/ipv6/netfilter/ip6table_filter.c:65:1-3: WARNING: PTR_RET can be used net/ipv6/netfilter/ip6table_mangle.c:100:1-3: WARNING: PTR_RET can be used net/ipv6/netfilter/ip6table_raw.c:44:1-3: WARNING: PTR_RET can be used net/ipv6/netfilter/ip6table_security.c:62:1-3: WARNING: PTR_RET can be used net/ipv4/netfilter/iptable_filter.c:72:1-3: WARNING: PTR_RET can be used net/ipv4/netfilter/iptable_mangle.c:107:1-3: WARNING: PTR_RET can …