[PATCH] e1000: ethtool: ensure to free old tx/rx rings in set_ringparam()

2018-07-18 Thread Bo Chen
m building. This patch fixes the bug by always calling 'kfree()' on old tx/rx rings in 'e1000_set_ringparam()'. Signed-off-by: Bo Chen --- drivers/net/ethernet/intel/e1000/e1000_ethtool.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethern

[PATCH] 8139too: Remove unnecessary netif_napi_del()

2018-05-24 Thread Bo Chen
The call to free_netdev() in __rtl8139_cleanup_dev() clears the network device napi list, and explicit calls to netif_napi_del() are unnecessary. Signed-off-by: Bo Chen --- drivers/net/ethernet/realtek/8139too.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/ethernet/realtek

Re: [PATCH] e1000: check the return of pci_get_drvdata() in e1000_remove()

2018-05-22 Thread Bo Chen
rong to assume 'dev_get_drvdata()' can return NULL and inject faults from it. Do you have any suggestions about how I can avoid such wrong assumptions? Thanks again for your time and attention. I hope this patch is not wasting too much effort from the netdev community. Any other comments or

[PATCH] e1000: check the return of pci_get_drvdata() in e1000_remove()

2018-05-22 Thread Bo Chen
This check on pci_get_drvdata() prevents potential invalid pointer dereferences, and is a common practice in *_remove() functions from other drivers, such as 'intel/e100.c', 'amd/pcnet32.c', 'realtek/8139too.c', and 'broadcom/tg3.c'. Signed-off-by: Bo Che

[PATCH] pcnet32: add an error handling path in pcnet32_probe_pci()

2018-05-21 Thread Bo Chen
Make sure to invoke pci_disable_device() when errors occur in pcnet32_probe_pci(). Signed-off-by: Bo Chen --- drivers/net/ethernet/amd/pcnet32.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/amd/pcnet32.c b/drivers/net/ethernet/amd/pcnet32