[PATCH] can: peak_pci: Make structure peak_pciec_i2c_bit_ops constant

2019-08-19 Thread Nishka Dasgupta
Static structure peak_pciec_i2c_bit_ops, of type i2c_algo_bit_data, is not used except to be copied into another variable. Hence make it const to protect it from modification. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers/net/can/sja1000/peak_pci.c | 2 +- 1 file

[PATCH] net: hns: hns_enet: Add of_node_put in hns_nic_dev_probe()

2019-08-14 Thread Nishka Dasgupta
The local variable ae_node in function hns_nic_dev_probe takes the return value of of_parse_phandle, which gets a node but does not put it. This may cause a memory leak. Hence put ae_node after the last time it is invoked. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers

[PATCH] net: dsa: qca8k: Add of_node_put() in qca8k_setup_mdio_bus()

2019-08-04 Thread Nishka Dasgupta
found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers/net/dsa/qca8k.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c index 232e8cc96f6d..87753e4423aa 100644 --- a/drivers/net/dsa/qca8k.c +++ b/drivers/net/dsa

[PATCH] net: dsa: mv88e6xxx: chip: Add of_node_put() before return

2019-07-23 Thread Nishka Dasgupta
Each iteration of for_each_available_child_of_node puts the previous node, but in the case of a return from the middle of the loop, there is no put, thus causing a memory leak. Hence add an of_node_put before the return. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers

[PATCH] net: ethernet: mediatek: mtk_eth_soc: Add of_node_put() before goto

2019-07-15 Thread Nishka Dasgupta
Each iteration of for_each_child_of_node puts the previous node, but in the case of a goto from the middle of the loop, there is no put, thus causing a memory leak. Hence add an of_node_put before the goto. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers/net/ethernet

[PATCH] net: ethernet: mscc: ocelot_board: Add of_node_put() before return

2019-07-15 Thread Nishka Dasgupta
Each iteration of for_each_available_child_of_node puts the previous node, but in the case of a return from the middle of the loop, there is no put, thus causing a memory leak. Hence add an of_node_put before the return in two places. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta

[PATCH] net: ethernet: ti: cpsw: Add of_node_put() before return and break

2019-07-15 Thread Nishka Dasgupta
ret; modify the return statements in the loop to save the return value in ret and goto this new label. For function cpsw_remove_dt, add an of_node_put before the break. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers/net/ethernet/ti/cpsw.c | 26 ++ 1