lkml.org 
[lkml]   [2010]   [Aug]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
Subject[PATCH] USB: Fix kernel oops with g_ether and Windows
From
Hello,

Please find attached patch for
https://bugzilla.kernel.org/show_bug.cgi?id=16023 problem.

Kind regards,
Maxim
From 43568dec4f387da4562d5bc81557c642a468b685 Mon Sep 17 00:00:00 2001
From: Maxim Osipov <maxim.osipov@gmail.com>
Date: Thu, 19 Aug 2010 07:25:28 +0400
Subject: [PATCH] USB: Fix kernel oops with g_ether and Windows

Signed-off-by: Maxim Osipov <maxim.osipov@gmail.com>
---
drivers/usb/gadget/rndis.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/gadget/rndis.c b/drivers/usb/gadget/rndis.c
index 5c0d06c..1043da1 100644
--- a/drivers/usb/gadget/rndis.c
+++ b/drivers/usb/gadget/rndis.c
@@ -292,9 +292,13 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
/* mandatory */
case OID_GEN_VENDOR_DESCRIPTION:
pr_debug("%s: OID_GEN_VENDOR_DESCRIPTION\n", __func__);
- length = strlen (rndis_per_dev_params [configNr].vendorDescr);
- memcpy (outbuf,
- rndis_per_dev_params [configNr].vendorDescr, length);
+ if ( rndis_per_dev_params [configNr].vendorDescr ) {
+ length = strlen (rndis_per_dev_params [configNr].vendorDescr);
+ memcpy (outbuf,
+ rndis_per_dev_params [configNr].vendorDescr, length);
+ } else {
+ outbuf[0] = 0;
+ }
retval = 0;
break;

--
1.7.1
\
 
 \ /
  Last update: 2010-08-21 12:57    [from the cache]
©2003-2011 Jasper Spaans