From: Dongliang Mu <hidden> Date: 2021-10-13 04:04:09
If register_candev fails, xcan_probe does not clean the napi
created by netif_napi_add.
Fix this by adding error handling code to clean napi when
register_candev fails.
Signed-off-by: Dongliang Mu <redacted>
---
drivers/net/can/xilinx_can.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
From: Dongliang Mu <hidden> Date: 2021-10-13 05:21:44
On Wed, Oct 13, 2021 at 12:04 PM Dongliang Mu [off-list ref] wrote:
If register_candev fails, xcan_probe does not clean the napi
created by netif_napi_add.
It seems the netif_napi_del operation is done in the free_candev
(free_netdev precisely).
list_for_each_entry_safe(p, n, &dev->napi_list, dev_list)
netif_napi_del(p);
And list_add_rcu(&napi->dev_list, &dev->napi_list) is done in the
netif_napi_add.
Therefore, I suggest removing "netif_napi_del" operation in the
xcan_remove to match probe and remove function.
quoted hunk
Fix this by adding error handling code to clean napi when
register_candev fails.
Signed-off-by: Dongliang Mu <redacted>
---
drivers/net/can/xilinx_can.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
From: Marc Kleine-Budde <mkl@pengutronix.de> Date: 2021-10-17 12:36:40
On 13.10.2021 13:21:09, Dongliang Mu wrote:
On Wed, Oct 13, 2021 at 12:04 PM Dongliang Mu [off-list ref] wrote:
quoted
If register_candev fails, xcan_probe does not clean the napi
created by netif_napi_add.
It seems the netif_napi_del operation is done in the free_candev
(free_netdev precisely).
list_for_each_entry_safe(p, n, &dev->napi_list, dev_list)
netif_napi_del(p);
And list_add_rcu(&napi->dev_list, &dev->napi_list) is done in the
netif_napi_add.
Therefore, I suggest removing "netif_napi_del" operation in the
xcan_remove to match probe and remove function.
Sounds reasonable, can you create a patch for this.
regards,
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung West/Dortmund | Phone: +49-231-2826-924 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
From: Dongliang Mu <hidden> Date: 2021-10-17 12:52:50
On Sun, Oct 17, 2021 at 8:36 PM Marc Kleine-Budde [off-list ref] wrote:
On 13.10.2021 13:21:09, Dongliang Mu wrote:
quoted
On Wed, Oct 13, 2021 at 12:04 PM Dongliang Mu [off-list ref] wrote:
quoted
If register_candev fails, xcan_probe does not clean the napi
created by netif_napi_add.
It seems the netif_napi_del operation is done in the free_candev
(free_netdev precisely).
list_for_each_entry_safe(p, n, &dev->napi_list, dev_list)
netif_napi_del(p);
And list_add_rcu(&napi->dev_list, &dev->napi_list) is done in the
netif_napi_add.
Therefore, I suggest removing "netif_napi_del" operation in the
xcan_remove to match probe and remove function.
Sounds reasonable, can you create a patch for this.
From: Marc Kleine-Budde <mkl@pengutronix.de> Date: 2021-10-17 20:16:43
On 17.10.2021 20:52:14, Dongliang Mu wrote:
On Sun, Oct 17, 2021 at 8:36 PM Marc Kleine-Budde [off-list ref] wrote:
quoted
On 13.10.2021 13:21:09, Dongliang Mu wrote:
quoted
On Wed, Oct 13, 2021 at 12:04 PM Dongliang Mu [off-list ref] wrote:
quoted
If register_candev fails, xcan_probe does not clean the napi
created by netif_napi_add.
It seems the netif_napi_del operation is done in the free_candev
(free_netdev precisely).
list_for_each_entry_safe(p, n, &dev->napi_list, dev_list)
netif_napi_del(p);
And list_add_rcu(&napi->dev_list, &dev->napi_list) is done in the
netif_napi_add.
Therefore, I suggest removing "netif_napi_del" operation in the
xcan_remove to match probe and remove function.
Sounds reasonable, can you create a patch for this.