Thread (4 messages) flat view 4 messages, 2 authors, 2016-08-17

Re: [PATCH 2/2] kaweth: fix oops upon failed memory allocation

From: Bjørn Mork <bjorn@mork.no>
Date: 2016-08-17 13:17:14

Oliver Neukum [off-list ref] writes:
quoted hunk ↗ jump to hunk
Just return an error upon failure.

Signed-off-by: Oliver Neukum <oneukum@suse.com>
---
 drivers/net/usb/kaweth.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c
index 37bf715..3cd6906 100644
--- a/drivers/net/usb/kaweth.c
+++ b/drivers/net/usb/kaweth.c
@@ -1049,6 +1049,8 @@ static int kaweth_probe(
 		/* Download the firmware */
 		dev_info(dev, "Downloading firmware...\n");
 		kaweth->firmware_buf = (__u8 *)__get_free_page(GFP_KERNEL);
+		if (!kaweth->firmware_buf)
+				return -ENOMEM;
Eh, that should be "goto err_free_netdev;", shouldn't it?



Bjørn
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help