Skip to contentSkip to conversation

drivers: use free_netdev before return

PATCH In review Minjie Du 3 participants 3 messages Jul 3, 2023 User-mode Linux (UML)

lore
Share & tools
lore

Minjie Du

author
#0 lore raw

PATCH v2 1/1 drivers: use free_netdev before return

We will replace the old version of
undo_user_init and use out_free_netdev

---
 arch/um/drivers/vector_kern.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
arch/um/drivers/vector_kern.c +1 -4
index af7f6fd4c..7ae6ab8df 100644
@@ -1646,7 +1646,7 @@ static void vector_eth_configure(
 	err = register_netdevice(dev);
 	rtnl_unlock();
 	if (err)
-		goto out_undo_user_init;
+		goto out_free_netdev;
 
 	spin_lock(&vector_devices_lock);
 	list_add(&device->list, &vector_devices);
@@ -1654,9 +1654,6 @@ static void vector_eth_configure(
 
 	return;
 
-out_undo_user_init:
-	free_netdev(dev);
-	return;
 out_free_netdev:
 	free_netdev(dev);
 out_free_device:
Signature · 1 line
2.39.0
maintainer Acked-by on v2 1/1
#1 lore raw
Quoted 22 lines · Minjie Du

We will replace the old version of
undo_user_init and use out_free_netdev

---
  arch/um/drivers/vector_kern.c | 5 +----
  1 file changed, 1 insertion(+), 4 deletions(-)
arch/um/drivers/vector_kern.c +1 -1
index af7f6fd4c..7ae6ab8df 100644
@@ -1646,7 +1646,7 @@ static void vector_eth_configure(
  	err = register_netdevice(dev);
  	rtnl_unlock();
  	if (err)
-		goto out_undo_user_init;
+		goto out_free_netdev;
 
  	spin_lock(&vector_devices_lock);
  	list_add(&device->list, &vector_devices);

arch/um/drivers/vector_kern.c static void vector_eth_configure( · line 1659

Quoted 9 lines
arch/um/drivers/vector_kern.c +0 -3
@@ -1654,9 +1654,6 @@ static void vector_eth_configure(
 
  	return;
 
-out_undo_user_init:
-	free_netdev(dev);
-	return;
  out_free_netdev:
  	free_netdev(dev);
  out_free_device:
Signature · 8 lines
Anton R. Ivanov
Cambridgegreys Limited. Registered in England. Company Number 10273661
https://www.cambridgegreys.com/

_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um
#2 lore raw

Re: [PATCH v2] drivers: use free_netdev before return in vector_eth_configure()

In reply to Minjie Du

Would the information “um: vector: …” be more appropriate for the subsystem specification in the patch subject?

Quoted 2 lines

We will replace the old version of
undo_user_init and use out_free_netdev

Please choose a better imperative change suggestion.

See also:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.4#n94

How do you think about to add the tag “Fixes”?

Regards,
Markus

_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um