Commit 4587a996 authored by David S. Miller's avatar David S. Miller

Merge branch 'kaweth-oopses'

Oliver Neukum says:

====================
fixes to kaweth in response to Umap2 testing

These patches fix an oops in firmware downloading and an oops due
to a memory allocation failure
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents b9f63ae7 575ced7f
...@@ -1009,6 +1009,7 @@ static int kaweth_probe( ...@@ -1009,6 +1009,7 @@ static int kaweth_probe(
struct net_device *netdev; struct net_device *netdev;
const eth_addr_t bcast_addr = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; const eth_addr_t bcast_addr = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
int result = 0; int result = 0;
int rv = -EIO;
dev_dbg(dev, dev_dbg(dev,
"Kawasaki Device Probe (Device number:%d): 0x%4.4x:0x%4.4x:0x%4.4x\n", "Kawasaki Device Probe (Device number:%d): 0x%4.4x:0x%4.4x:0x%4.4x\n",
...@@ -1029,6 +1030,7 @@ static int kaweth_probe( ...@@ -1029,6 +1030,7 @@ static int kaweth_probe(
kaweth = netdev_priv(netdev); kaweth = netdev_priv(netdev);
kaweth->dev = udev; kaweth->dev = udev;
kaweth->net = netdev; kaweth->net = netdev;
kaweth->intf = intf;
spin_lock_init(&kaweth->device_lock); spin_lock_init(&kaweth->device_lock);
init_waitqueue_head(&kaweth->term_wait); init_waitqueue_head(&kaweth->term_wait);
...@@ -1048,6 +1050,10 @@ static int kaweth_probe( ...@@ -1048,6 +1050,10 @@ static int kaweth_probe(
/* Download the firmware */ /* Download the firmware */
dev_info(dev, "Downloading firmware...\n"); dev_info(dev, "Downloading firmware...\n");
kaweth->firmware_buf = (__u8 *)__get_free_page(GFP_KERNEL); kaweth->firmware_buf = (__u8 *)__get_free_page(GFP_KERNEL);
if (!kaweth->firmware_buf) {
rv = -ENOMEM;
goto err_free_netdev;
}
if ((result = kaweth_download_firmware(kaweth, if ((result = kaweth_download_firmware(kaweth,
"kaweth/new_code.bin", "kaweth/new_code.bin",
100, 100,
...@@ -1139,8 +1145,6 @@ static int kaweth_probe( ...@@ -1139,8 +1145,6 @@ static int kaweth_probe(
dev_dbg(dev, "Initializing net device.\n"); dev_dbg(dev, "Initializing net device.\n");
kaweth->intf = intf;
kaweth->tx_urb = usb_alloc_urb(0, GFP_KERNEL); kaweth->tx_urb = usb_alloc_urb(0, GFP_KERNEL);
if (!kaweth->tx_urb) if (!kaweth->tx_urb)
goto err_free_netdev; goto err_free_netdev;
...@@ -1204,7 +1208,7 @@ static int kaweth_probe( ...@@ -1204,7 +1208,7 @@ static int kaweth_probe(
err_free_netdev: err_free_netdev:
free_netdev(netdev); free_netdev(netdev);
return -EIO; return rv;
} }
/**************************************************************** /****************************************************************
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment