USB: serial: digi_acceleport: fix incomplete rx sanity check
authorJohan Hovold <johan@kernel.org>
Tue, 31 Jan 2017 16:17:28 +0000 (17:17 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Mon, 5 Jun 2017 20:13:46 +0000 (21:13 +0100)
commit0ec745967dbf486a05082f67e67910afa3a9d319
treee3ced6def57ac1dc10491cfac75259b5d57b7006
parent9a1f83c1a55eb363f6e09c5fbe27254329c3ae1a
USB: serial: digi_acceleport: fix incomplete rx sanity check

commit 1b0aed2b1600f6e5c7b9acfbd610a4e351ef5232 upstream.

Make sure the received data has the required headers before parsing it.

Also drop the redundant urb-status check, which has already been handled
by the caller.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/usb/serial/digi_acceleport.c