Author: lcapitulino
Date: Fri Feb  9 20:19:52 2007
New Revision: 118610

Added:
   
packages/updates/2007.0/kernel-2.6/current/PATCHES/patches/DU22_rndis_host_nokia_mobile_crash_fix.patch
Modified:
   packages/updates/2007.0/kernel-2.6/current/SPECS/kernel-2.6.spec

Log:
USB: rndis_host: fix crash while probing a Nokia S60 mobile


Added: 
packages/updates/2007.0/kernel-2.6/current/PATCHES/patches/DU22_rndis_host_nokia_mobile_crash_fix.patch
==============================================================================
--- (empty file)
+++ 
packages/updates/2007.0/kernel-2.6/current/PATCHES/patches/DU22_rndis_host_nokia_mobile_crash_fix.patch
     Fri Feb  9 20:19:52 2007
@@ -0,0 +1,91 @@
+commit deb31f1764e0a11bcfe8d44e0658f83d83860e84
+Author: Daniel Gollub <[EMAIL PROTECTED]>
+Date:   Tue Jan 16 11:03:01 2007 +0100
+
+    USB: rndis_host: fix crash while probing a Nokia S60 mobile
+    
+    Bug fix for driver rndis_host which fixes rndis_host probing certain
+    Nokia S60 (Series 60) mobiles. While the rndis_host get probed by usbnet
+    and tries to bind the Nokia mobile the bind is going to fail. The
+    rndis_host module tries to release the device, in a wrong way, which
+    cause the oops.
+    
+    Fixes Bugzilla #7201
+    
+    Signed-off-by: Daniel Gollub <[EMAIL PROTECTED]>
+    Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
+
+---
+ drivers/usb/net/rndis_host.c |   23 ++++++++++++++---------
+ 1 file changed, 14 insertions(+), 9 deletions(-)
+
+--- linux-2.6.17.orig/drivers/usb/net/rndis_host.c
++++ linux-2.6.17/drivers/usb/net/rndis_host.c
+@@ -380,6 +380,7 @@ static int rndis_bind(struct usbnet *dev
+ {
+       int                     retval;
+       struct net_device       *net = dev->net;
++      struct cdc_state        *info = (void *) &dev->data;
+       union {
+               void                    *buf;
+               struct rndis_msg_hdr    *header;
+@@ -398,7 +399,7 @@ static int rndis_bind(struct usbnet *dev
+               return -ENOMEM;
+       retval = usbnet_generic_cdc_bind(dev, intf);
+       if (retval < 0)
+-              goto done;
++              goto fail;
+ 
+       net->hard_header_len += sizeof (struct rndis_data_hdr);
+ 
+@@ -413,10 +414,7 @@ static int rndis_bind(struct usbnet *dev
+       if (unlikely(retval < 0)) {
+               /* it might not even be an RNDIS device!! */
+               dev_err(&intf->dev, "RNDIS init failed, %d\n", retval);
+-fail:
+-              usb_driver_release_interface(driver_of(intf),
+-                      ((struct cdc_state *)&(dev->data))->data);
+-              goto done;
++              goto fail_and_release;
+       }
+       dev->hard_mtu = le32_to_cpu(u.init_c->max_transfer_size);
+       /* REVISIT:  peripheral "alignment" request is ignored ... */
+@@ -432,7 +430,7 @@ fail:
+       retval = rndis_command(dev, u.header);
+       if (unlikely(retval < 0)) {
+               dev_err(&intf->dev, "rndis get ethaddr, %d\n", retval);
+-              goto fail;
++              goto fail_and_release;
+       }
+       tmp = le32_to_cpu(u.get_c->offset);
+       if (unlikely((tmp + 8) > (1024 - ETH_ALEN)
+@@ -440,7 +438,7 @@ fail:
+               dev_err(&intf->dev, "rndis ethaddr off %d len %d ?\n",
+                       tmp, le32_to_cpu(u.get_c->len));
+               retval = -EDOM;
+-              goto fail;
++              goto fail_and_release;
+       }
+       memcpy(net->dev_addr, tmp + (char *)&u.get_c->request_id, ETH_ALEN);
+ 
+@@ -456,11 +454,18 @@ fail:
+       retval = rndis_command(dev, u.header);
+       if (unlikely(retval < 0)) {
+               dev_err(&intf->dev, "rndis set packet filter, %d\n", retval);
+-              goto fail;
++              goto fail_and_release;
+       }
+ 
+       retval = 0;
+-done:
++
++      kfree(u.buf);
++      return retval;
++
++fail_and_release:
++      usb_set_intfdata(info->data, NULL);
++      usb_driver_release_interface(driver_of(intf), info->data);
++fail:
+       kfree(u.buf);
+       return retval;
+ }

Modified: packages/updates/2007.0/kernel-2.6/current/SPECS/kernel-2.6.spec
==============================================================================
--- packages/updates/2007.0/kernel-2.6/current/SPECS/kernel-2.6.spec    
(original)
+++ packages/updates/2007.0/kernel-2.6/current/SPECS/kernel-2.6.spec    Fri Feb 
 9 20:19:52 2007
@@ -1036,6 +1036,7 @@
     - x86_64: Add /proc/config.gz support (CONFIG_IKCONFIG)
     - x86_64: Add stack overflow support. Disabled by default, but it's
       something good to have at hand
+    - USB: rndis_host: fix crash while probing a Nokia S60 mobile
 
 * Fri Feb 02 2007 Luiz Capitulino <[EMAIL PROTECTED]> 2.6.17-10mdv2007.0
   o Gwenole Beauchesne <[EMAIL PROTECTED]>

Reply via email to