Re: [PATCH] net/mlx4_en: Fix an error handling path in 'mlx4_en_init_netdev()'

2018-05-10 Thread Tariq Toukan
On 10/05/2018 5:36 PM, Tariq Toukan wrote: On 10/05/2018 5:18 PM, Dan Carpenter wrote: On Thu, May 10, 2018 at 04:38:08PM +0300, Yuval Shaia wrote: On Thu, May 10, 2018 at 09:02:26AM +0200, Christophe JAILLET wrote: If an error occurs, 'mlx4_en_destroy_netdev()' is called. It then calls

Re: [PATCH] net/mlx4_en: Fix an error handling path in 'mlx4_en_init_netdev()'

2018-05-10 Thread Tariq Toukan
On 10/05/2018 5:36 PM, Tariq Toukan wrote: On 10/05/2018 5:18 PM, Dan Carpenter wrote: On Thu, May 10, 2018 at 04:38:08PM +0300, Yuval Shaia wrote: On Thu, May 10, 2018 at 09:02:26AM +0200, Christophe JAILLET wrote: If an error occurs, 'mlx4_en_destroy_netdev()' is called. It then calls

Re: [PATCH] net/mlx4_en: Fix an error handling path in 'mlx4_en_init_netdev()'

2018-05-10 Thread Tariq Toukan
On 10/05/2018 5:18 PM, Dan Carpenter wrote: On Thu, May 10, 2018 at 04:38:08PM +0300, Yuval Shaia wrote: On Thu, May 10, 2018 at 09:02:26AM +0200, Christophe JAILLET wrote: If an error occurs, 'mlx4_en_destroy_netdev()' is called. It then calls 'mlx4_en_free_resources()' which does the

Re: [PATCH] net/mlx4_en: Fix an error handling path in 'mlx4_en_init_netdev()'

2018-05-10 Thread Tariq Toukan
On 10/05/2018 5:18 PM, Dan Carpenter wrote: On Thu, May 10, 2018 at 04:38:08PM +0300, Yuval Shaia wrote: On Thu, May 10, 2018 at 09:02:26AM +0200, Christophe JAILLET wrote: If an error occurs, 'mlx4_en_destroy_netdev()' is called. It then calls 'mlx4_en_free_resources()' which does the

Re: [PATCH] net/mlx4_en: Fix an error handling path in 'mlx4_en_init_netdev()'

2018-05-10 Thread Christophe JAILLET
Le 10/05/2018 à 15:38, Yuval Shaia a écrit : On Thu, May 10, 2018 at 09:02:26AM +0200, Christophe JAILLET wrote: If an error occurs, 'mlx4_en_destroy_netdev()' is called. It then calls 'mlx4_en_free_resources()' which does the needed resources cleanup. So, doing some explicit kfree in the

Re: [PATCH] net/mlx4_en: Fix an error handling path in 'mlx4_en_init_netdev()'

2018-05-10 Thread Christophe JAILLET
Le 10/05/2018 à 15:38, Yuval Shaia a écrit : On Thu, May 10, 2018 at 09:02:26AM +0200, Christophe JAILLET wrote: If an error occurs, 'mlx4_en_destroy_netdev()' is called. It then calls 'mlx4_en_free_resources()' which does the needed resources cleanup. So, doing some explicit kfree in the

Re: [PATCH] net/mlx4_en: Fix an error handling path in 'mlx4_en_init_netdev()'

2018-05-10 Thread Dan Carpenter
On Thu, May 10, 2018 at 04:38:08PM +0300, Yuval Shaia wrote: > On Thu, May 10, 2018 at 09:02:26AM +0200, Christophe JAILLET wrote: > > If an error occurs, 'mlx4_en_destroy_netdev()' is called. > > It then calls 'mlx4_en_free_resources()' which does the needed resources > > cleanup. > > > > So,

Re: [PATCH] net/mlx4_en: Fix an error handling path in 'mlx4_en_init_netdev()'

2018-05-10 Thread Dan Carpenter
On Thu, May 10, 2018 at 04:38:08PM +0300, Yuval Shaia wrote: > On Thu, May 10, 2018 at 09:02:26AM +0200, Christophe JAILLET wrote: > > If an error occurs, 'mlx4_en_destroy_netdev()' is called. > > It then calls 'mlx4_en_free_resources()' which does the needed resources > > cleanup. > > > > So,

Re: [PATCH] net/mlx4_en: Fix an error handling path in 'mlx4_en_init_netdev()'

2018-05-10 Thread Yuval Shaia
On Thu, May 10, 2018 at 09:02:26AM +0200, Christophe JAILLET wrote: > If an error occurs, 'mlx4_en_destroy_netdev()' is called. > It then calls 'mlx4_en_free_resources()' which does the needed resources > cleanup. > > So, doing some explicit kfree in the error handling path would lead to > some

Re: [PATCH] net/mlx4_en: Fix an error handling path in 'mlx4_en_init_netdev()'

2018-05-10 Thread Yuval Shaia
On Thu, May 10, 2018 at 09:02:26AM +0200, Christophe JAILLET wrote: > If an error occurs, 'mlx4_en_destroy_netdev()' is called. > It then calls 'mlx4_en_free_resources()' which does the needed resources > cleanup. > > So, doing some explicit kfree in the error handling path would lead to > some

[PATCH] net/mlx4_en: Fix an error handling path in 'mlx4_en_init_netdev()'

2018-05-10 Thread Christophe JAILLET
If an error occurs, 'mlx4_en_destroy_netdev()' is called. It then calls 'mlx4_en_free_resources()' which does the needed resources cleanup. So, doing some explicit kfree in the error handling path would lead to some double kfree. Simplify code to avoid such a case. Fixes: 67f8b1dcb9ee

[PATCH] net/mlx4_en: Fix an error handling path in 'mlx4_en_init_netdev()'

2018-05-10 Thread Christophe JAILLET
If an error occurs, 'mlx4_en_destroy_netdev()' is called. It then calls 'mlx4_en_free_resources()' which does the needed resources cleanup. So, doing some explicit kfree in the error handling path would lead to some double kfree. Simplify code to avoid such a case. Fixes: 67f8b1dcb9ee

Re: [PATCH] net/mlx4_en: Fix an error handling path in 'mlx4_en_init_netdev()'

2018-05-09 Thread Tariq Toukan
On 08/05/2018 12:34 PM, Christophe JAILLET wrote: If the 2nd memory allocation of the loop fails, we must undo the memory allocation done so far. Fixes: 67f8b1dcb9ee ("net/mlx4_en: Refactor the XDP forwarding rings scheme") Signed-off-by: Christophe JAILLET ---

Re: [PATCH] net/mlx4_en: Fix an error handling path in 'mlx4_en_init_netdev()'

2018-05-09 Thread Tariq Toukan
On 08/05/2018 12:34 PM, Christophe JAILLET wrote: If the 2nd memory allocation of the loop fails, we must undo the memory allocation done so far. Fixes: 67f8b1dcb9ee ("net/mlx4_en: Refactor the XDP forwarding rings scheme") Signed-off-by: Christophe JAILLET ---

[PATCH] net/mlx4_en: Fix an error handling path in 'mlx4_en_init_netdev()'

2018-05-08 Thread Christophe JAILLET
If the 2nd memory allocation of the loop fails, we must undo the memory allocation done so far. Fixes: 67f8b1dcb9ee ("net/mlx4_en: Refactor the XDP forwarding rings scheme") Signed-off-by: Christophe JAILLET --- drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 2

[PATCH] net/mlx4_en: Fix an error handling path in 'mlx4_en_init_netdev()'

2018-05-08 Thread Christophe JAILLET
If the 2nd memory allocation of the loop fails, we must undo the memory allocation done so far. Fixes: 67f8b1dcb9ee ("net/mlx4_en: Refactor the XDP forwarding rings scheme") Signed-off-by: Christophe JAILLET --- drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 2 +- 1 file changed, 1