linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: usb: Make init_satus() return -ENOMEM if alloc failed
@ 2025-07-16  0:15 Zqiang
  2025-07-16  0:15 ` [PATCH] net: usb: Remove duplicate assignments for net->pcpu_stat_type Zqiang
  2025-07-16  9:18 ` [PATCH] net: usb: Make init_satus() return -ENOMEM if alloc failed Simon Horman
  0 siblings, 2 replies; 8+ messages in thread
From: Zqiang @ 2025-07-16  0:15 UTC (permalink / raw)
  To: oneukum, kuba, andrew+netdev, davem, pabeni
  Cc: qiang.zhang, netdev, linux-kernel

This commit make init_status() return -ENOMEM, if invoke
kmalloc() return failed.

Signed-off-by: Zqiang <qiang.zhang@linux.dev>
---
 drivers/net/usb/usbnet.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index 921c05bc73e3..26fce452581c 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -254,6 +254,8 @@ static int init_status (struct usbnet *dev, struct usb_interface *intf)
 				"status ep%din, %d bytes period %d\n",
 				usb_pipeendpoint(pipe), maxp, period);
 		}
+	} else {
+		return -ENOMEM;
 	}
 	return 0;
 }
-- 
2.48.1


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

end of thread, other threads:[~2025-07-21  9:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-16  0:15 [PATCH] net: usb: Make init_satus() return -ENOMEM if alloc failed Zqiang
2025-07-16  0:15 ` [PATCH] net: usb: Remove duplicate assignments for net->pcpu_stat_type Zqiang
2025-07-16  9:19   ` Simon Horman
2025-07-16 22:11   ` Jakub Kicinski
2025-07-17  0:08     ` qiang.zhang
2025-07-21  9:50   ` patchwork-bot+netdevbpf
2025-07-16  9:18 ` [PATCH] net: usb: Make init_satus() return -ENOMEM if alloc failed Simon Horman
2025-07-17  0:04   ` qiang.zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).