From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@kernel.org
Cc: stable-review@kernel.org, torvalds@linux-foundation.org,
akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk,
"Jiri Slaby" <jslaby@suse.cz>,
"Rémi Denis-Courmont" <remi.denis-courmont@nokia.com>,
"David S. Miller" <davem@davemloft.net>
Subject: [04/26] NET: cdc-phonet, handle empty phonet header
Date: Tue, 19 Apr 2011 14:02:20 -0700 [thread overview]
Message-ID: <20110419210322.669015556@clark.kroah.org> (raw)
In-Reply-To: <20110419210333.GA17417@kroah.com>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2092 bytes --]
2.6.33-longterm review patch. If anyone has any objections, please let us know.
------------------
From: Jiri Slaby <jslaby@suse.cz>
commit 468c3f924f043cad7a04f4f4d5224a2c9bc886c1 upstream.
Currently, for N 5800 XM I get:
cdc_phonet: probe of 1-6:1.10 failed with error -22
It's because phonet_header is empty. Extra altsetting looks like
there:
E 05 24 00 01 10 03 24 ab 05 24 06 0a 0b 04 24 fd .$....$..$....$.
E 00 .
I don't see the header used anywhere so just check if the phonet
descriptor is there, not the structure itself.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Cc: David S. Miller <davem@davemloft.net>
Acked-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/net/usb/cdc-phonet.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
--- a/drivers/net/usb/cdc-phonet.c
+++ b/drivers/net/usb/cdc-phonet.c
@@ -325,13 +325,13 @@ int usbpn_probe(struct usb_interface *in
{
static const char ifname[] = "usbpn%d";
const struct usb_cdc_union_desc *union_header = NULL;
- const struct usb_cdc_header_desc *phonet_header = NULL;
const struct usb_host_interface *data_desc;
struct usb_interface *data_intf;
struct usb_device *usbdev = interface_to_usbdev(intf);
struct net_device *dev;
struct usbpn_dev *pnd;
u8 *data;
+ int phonet = 0;
int len, err;
data = intf->altsetting->extra;
@@ -352,10 +352,7 @@ int usbpn_probe(struct usb_interface *in
(struct usb_cdc_union_desc *)data;
break;
case 0xAB:
- if (phonet_header || dlen < 5)
- break;
- phonet_header =
- (struct usb_cdc_header_desc *)data;
+ phonet = 1;
break;
}
}
@@ -363,7 +360,7 @@ int usbpn_probe(struct usb_interface *in
len -= dlen;
}
- if (!union_header || !phonet_header)
+ if (!union_header || !phonet)
return -EINVAL;
data_intf = usb_ifnum_to_if(usbdev, union_header->bSlaveInterface0);
next prev parent reply other threads:[~2011-04-19 21:04 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-19 21:03 [00/26] 2.6.33.12-longterm review Greg KH
2011-04-19 21:02 ` [01/26] cifs: always do is_path_accessible check in cifs_mount Greg KH
2011-04-19 21:02 ` [02/26] [media] video: sn9c102: world-wirtable sysfs files Greg KH
2011-04-19 21:02 ` [03/26] UBIFS: restrict world-writable debugfs files Greg KH
2011-04-19 21:02 ` Greg KH [this message]
2011-04-19 21:02 ` [05/26] x86: Fix a bogus unwind annotation in lib/semaphore_32.S Greg KH
2011-04-19 21:02 ` [06/26] [IA64] tioca: Fix assignment from incompatible pointer warnings Greg KH
2011-04-19 21:02 ` [07/26] [IA64] mca.c: Fix cast from integer to pointer warning Greg KH
2011-04-19 21:02 ` [08/26] ramfs: fix memleak on no-mmu arch Greg KH
2011-04-19 21:02 ` [09/26] MAINTAINERS: update STABLE BRANCH info Greg KH
2011-04-19 21:02 ` [10/26] UBIFS: fix oops when R/O file-system is fsynced Greg KH
2011-04-19 21:02 ` [11/26] x86, AMD: Set ARAT feature on AMD processors Greg KH
2011-04-19 21:02 ` [12/26] x86, cpu: AMD errata checking framework Greg KH
2011-04-19 21:02 ` [13/26] x86, cpu: Clean up AMD erratum 400 workaround Greg KH
2011-04-19 21:02 ` [14/26] x86, amd: Disable GartTlbWlkErr when BIOS forgets it Greg KH
2011-04-19 21:02 ` [15/26] USB: ftdi_sio: Added IDs for CTI USB Serial Devices Greg KH
2011-04-19 21:02 ` [16/26] USB: ftdi_sio: add PID for OCT DK201 docking station Greg KH
2011-04-19 21:02 ` [17/26] USB: ftdi_sio: add ids for Hameg HO720 and HO730 Greg KH
2011-04-19 21:02 ` [18/26] next_pidmap: fix overflow condition Greg KH
2011-04-19 21:02 ` [19/26] proc: do proper range check on readdir offset Greg KH
2011-04-19 21:02 ` [20/26] USB: EHCI: unlink unused QHs when the controller is stopped Greg KH
2011-04-19 21:02 ` [21/26] USB: fix formatting of SuperSpeed endpoints in /proc/bus/usb/devices Greg KH
2011-04-19 21:02 ` [22/26] USB: xhci - fix unsafe macro definitions Greg KH
2011-04-19 21:02 ` [23/26] USB: xhci - fix math in xhci_get_endpoint_interval() Greg KH
2011-04-19 21:02 ` [24/26] x86, cpu: Fix regression in AMD errata checking code Greg KH
2011-04-19 21:02 ` [25/26] net: ax25: fix information leak to userland harder Greg KH
2011-04-19 21:02 ` [26/26] net: fix rds_iovec page count overflow Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110419210322.669015556@clark.kroah.org \
--to=gregkh@suse.de \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=davem@davemloft.net \
--cc=jslaby@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=remi.denis-courmont@nokia.com \
--cc=stable-review@kernel.org \
--cc=stable@kernel.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®