liquidio: remove unnecessary NULL check before kfree in delete_glists
Subsystems (3)
PATCH 1/2 liquidio: remove unnecessary NULL check before kfree in delete_glists
NULL check before freeing functions like kfree is not needed.
This issue was detected with the help of Coccinelle.
---
This code was tested by compilation only.
drivers/net/ethernet/cavium/liquidio/lio_vf_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/cavium/liquidio/lio_vf_main.c +1 -2
@@ -435,8 +435,7 @@ static void delete_glists(struct lio *lio)do { g = (struct octnic_gather *)list_delete_head (&lio->glist[i]); -if (g) -kfree (g); +kfree (g); }while (g); if (lio->glists_virt_base && lio->glists_virt_base[i] &&
Signature · 1 line
2.7.4
PATCH 2/2 liquidio: mark expected switch fall-through in octeon_destroy_resources
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
---
This code was tested by compilation only (GCC 7.2.0 was used). Please, verify if the actual intention of the code is to fall through.
drivers/net/ethernet/cavium/liquidio/lio_vf_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/cavium/liquidio/lio_vf_main.c +1 -1
@@ -747,7 +747,7 @@ static void octeon_destroy_resources(struct octeon_device *oct)if (lio_wait_for_oq_pkts (oct))dev_err (&oct->pci_dev->dev,"OQ had pending packets\n" ); - +/* fall through */ case OCT_DEV_INTR_SET_DONE :/* Disable interrupts */ oct->fn_list.disable_interrupt (oct,OCTEON_ALL_INTR );
Signature · 1 line
2.7.4
Re: [PATCH 2/2] liquidio: mark expected switch fall-through in octeon_destroy_resources
Quoted 27 lines · Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
Signed-off-by Gustavo A. R. Silva <[email protected]>---
This code was tested by compilation only (GCC 7.2.0 was used). Please, verify if the actual intention of the code is to fall through.drivers/net/ethernet/cavium/liquidio/lio_vf_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/cavium/liquidio/lio_vf_main.c +1
-1@@ -747,7 +747,7 @@ static void octeon_destroy_resources(struct octeon_device *oct)if (lio_wait_for_oq_pkts (oct))dev_err (&oct->pci_dev->dev,"OQ had pending packets\n" ); - +/* fall through */ case OCT_DEV_INTR_SET_DONE :/* Disable interrupts */ oct->fn_list.disable_interrupt (oct,OCTEON_ALL_INTR );Signature · 1 line
2.7.4
Re: [PATCH 2/2] liquidio: mark expected switch fall-through in octeon_destroy_resources
In reply to Gustavo A. R. SilvaFrom: "Gustavo A. R. Silva" <[email protected]>
Date: Tue, 17 Oct 2017 14:01:45 -0500
Quoted 4 lines
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
Signed-off-by Gustavo A. R. Silva <[email protected]>
Applied to net-next.
Quoted 28 lines · Gustavo A. R. Silva
NULL check before freeing functions like kfree is not needed.
This issue was detected with the help of Coccinelle.
Signed-off-by Gustavo A. R. Silva <[email protected]>---
This code was tested by compilation only.drivers/net/ethernet/cavium/liquidio/lio_vf_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/net/ethernet/cavium/liquidio/lio_vf_main.c +1
-2@@ -435,8 +435,7 @@ static void delete_glists(struct lio *lio)do { g = (struct octnic_gather *)list_delete_head (&lio->glist[i]); -if (g) -kfree (g); +kfree (g); }while (g); if (lio->glists_virt_base && lio->glists_virt_base[i] &&Signature · 1 line
2.7.4
From: "Gustavo A. R. Silva" <[email protected]>
Date: Tue, 17 Oct 2017 13:59:20 -0500
Quoted 5 lines
NULL check before freeing functions like kfree is not needed.
This issue was detected with the help of Coccinelle.
Signed-off-by Gustavo A. R. Silva <[email protected]>
Applied to net-next.