mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v1] drivers: use free_netdev before return
@ 2023-07-03  9:41 Minjie Du
  2023-07-03 10:12 ` Anton Ivanov
  0 siblings, 1 reply; 2+ messages in thread
From: Minjie Du @ 2023-07-03  9:41 UTC (permalink / raw)
  To: richard, anton.ivanov, johannes, sfr, linux-um, linux-kernel, machel
  Cc: opensource.kernel, Minjie Du

We fixed a bug where the variable dev
was not freed before return.

Signed-off-by: Minjie Du <duminjie@vivo.com>
---
 arch/um/drivers/vector_kern.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/um/drivers/vector_kern.c b/arch/um/drivers/vector_kern.c
index 131b7cb29..af7f6fd4c 100644
--- a/arch/um/drivers/vector_kern.c
+++ b/arch/um/drivers/vector_kern.c
@@ -1655,6 +1655,7 @@ static void vector_eth_configure(
 	return;
 
 out_undo_user_init:
+	free_netdev(dev);
 	return;
 out_free_netdev:
 	free_netdev(dev);
-- 
2.39.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v1] drivers: use free_netdev before return
  2023-07-03  9:41 [PATCH v1] drivers: use free_netdev before return Minjie Du
@ 2023-07-03 10:12 ` Anton Ivanov
  0 siblings, 0 replies; 2+ messages in thread
From: Anton Ivanov @ 2023-07-03 10:12 UTC (permalink / raw)
  To: Minjie Du, richard, johannes, sfr, linux-um, linux-kernel, machel
  Cc: opensource.kernel



On 03/07/2023 10:41, Minjie Du wrote:
> We fixed a bug where the variable dev
> was not freed before return.
> 
> Signed-off-by: Minjie Du <duminjie@vivo.com>
> ---
>   arch/um/drivers/vector_kern.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/arch/um/drivers/vector_kern.c b/arch/um/drivers/vector_kern.c
> index 131b7cb29..af7f6fd4c 100644
> --- a/arch/um/drivers/vector_kern.c
> +++ b/arch/um/drivers/vector_kern.c
> @@ -1655,6 +1655,7 @@ static void vector_eth_configure(
>   	return;
>   
>   out_undo_user_init:

undo_user_init looks like an orphan from older code versions.

It should go away completely - jump to out_free_netdev instead.

> +	free_netdev(dev);
>   	return;
>   out_free_netdev:
>   	free_netdev(dev);

-- 
Anton R. Ivanov
Cambridgegreys Limited. Registered in England. Company Number 10273661
https://www.cambridgegreys.com/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-07-03 10:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-03  9:41 [PATCH v1] drivers: use free_netdev before return Minjie Du
2023-07-03 10:12 ` Anton Ivanov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®