diff options
author | Paul Fertser <fercerpav@gmail.com> | 2009-06-11 10:16:14 +0400 |
---|---|---|
committer | Nelson Castillo <arhuaco@freaks-unidos.net> | 2009-06-21 00:32:18 -0500 |
commit | 4e418ad2a6bae9681a7863ab8f376ce47da3e33a (patch) | |
tree | e09498a19ae0e054d7c00b108d8707ab65890b4d | |
parent | 5a6ed99264c704e517ac312283c58204ee38fee5 (diff) |
RNDIS: crude hack to fix oops on connecting to WXP SP2
F4t discovered that his freerunner panics on connect to his windows box.
This crude hack workarounds the problem.
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
-rw-r--r-- | drivers/usb/gadget/rndis.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/drivers/usb/gadget/rndis.c b/drivers/usb/gadget/rndis.c index 8c26f5ea2b8..c719b1efcbc 100644 --- a/drivers/usb/gadget/rndis.c +++ b/drivers/usb/gadget/rndis.c @@ -294,9 +294,22 @@ 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 { + /* + * FIXME: Openmoko hack by Paul Fertser to avoid + * panic with Win XP SP2 when vendorDescr is NULL + * (always ATM). + */ + length = 5; + memcpy(outbuf, "dummy", length); + } retval = 0; break; |