public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] USB: Fix kernel oops with g_ether and Windows
@ 2010-08-21 10:54 Maxim Osipov
  2010-08-21 13:27 ` Sergei Shtylyov
  2010-09-06 14:37 ` Gadiyar, Anand
  0 siblings, 2 replies; 13+ messages in thread
From: Maxim Osipov @ 2010-08-21 10:54 UTC (permalink / raw)
  To: David Brownell, Greg Kroah-Hartman, Maxim Osipov, linux-usb,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 119 bytes --]

Hello,

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

Kind regards,
Maxim

[-- Attachment #2: 0001-USB-Fix-kernel-oops-with-g_ether-and-Windows.patch --]
[-- Type: text/x-patch, Size: 1159 bytes --]

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


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

end of thread, other threads:[~2011-10-13  0:47 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-21 10:54 [PATCH] USB: Fix kernel oops with g_ether and Windows Maxim Osipov
2010-08-21 13:27 ` Sergei Shtylyov
2010-09-06 14:37 ` Gadiyar, Anand
2010-09-06 20:18   ` Greg KH
2010-09-07  9:55     ` Sergei Shtylyov
2010-09-07 10:12       ` Maxim Osipov
2010-09-07 10:48         ` Gadiyar, Anand
2010-09-07 21:29           ` Greg KH
2010-09-07 23:54             ` Mihai Donțu
2010-09-08  0:34               ` Greg KH
2011-10-12 23:31                 ` Aras Vaichas
2011-10-13  0:12                   ` Greg KH
2011-10-13  0:46                     ` Aras Vaichas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox