summaryrefslogtreecommitdiff
path: root/drivers/usb
AgeCommit message (Collapse)Author
2012-10-31USB: EHCI: remove unused Link Power Management codeAlan Stern
This patch (as1622) removes the USB-2.1 Link Power Management code from the ehci-hcd driver. This code was never integrated with usbcore, it is full of bugs, and it was not getting used by anybody. However, the debugging code for dumping the LPM-related fields in the EHCI registers is left in place. In theory it might be useful to see these values, even though we don't use them. This essentially amounts to a partial revert of commit aa4d8342988d0c1a79ff19b2ede1e81dfbb16ea5 (USB: EHCI: EHCI 1.1 addendum: preparation) and an almost full revert of commit 48f24970144479c29b8cee6d2e1dbedf6dcf9cfb (USB: EHCI: EHCI 1.1 addendum: Basic LPM feature support) plus its follow-ons. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-31USB: remove iteration limit in hub_tt_work()Alan Stern
This patch (as1621) removes the limit on the number of loops allowed in hub_tt_work(). The value is arbitrary, and it's silly to have a limit in the first place -- anything beyond the limit would not get handled. Besides, it's most unlikely that we'll ever need to clear more than a couple of TT buffers at any time. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-31USB: serial: remove driver version informationJohan Hovold
Remove all MODULE_VERSION macros and driver-version information (except for garmin_gps which uses it in a status reply). It is the kernel version that matters and not some private version scheme which rarely even gets updated. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30USB: ums_realtek: fix build warningJingoo Han
When rts51x_read_status() returns USB_STOR_TRANSPORT_ERROR, an error happens. This patch fixes build warning as below: drivers/usb/storage/realtek_cr.c: In function 'init_realtek_cr': drivers/usb/storage/realtek_cr.c:476:33: warning: 'buf[15]' may be used uninitialized in this function [-Wuninitialized] drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[15]' was declared here drivers/usb/storage/realtek_cr.c:475:33: warning: 'buf[14]' may be used uninitialized in this function [-Wuninitialized] drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[14]' was declared here drivers/usb/storage/realtek_cr.c:474:50: warning: 'buf[13]' may be used uninitialized in this function [-Wuninitialized] drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[13]' was declared here drivers/usb/storage/realtek_cr.c:472:30: warning: 'buf[12]' may be used uninitialized in this function [-Wuninitialized] drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[12]' was declared here drivers/usb/storage/realtek_cr.c:471:31: warning: 'buf[11]' may be used uninitialized in this function [-Wuninitialized] drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[11]' was declared here drivers/usb/storage/realtek_cr.c:470:31: warning: 'buf[10]' may be used uninitialized in this function [-Wuninitialized] drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[10]' was declared here drivers/usb/storage/realtek_cr.c:469:30: warning: 'buf[9]' may be used uninitialized in this function [-Wuninitialized] drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[9]' was declared here drivers/usb/storage/realtek_cr.c:468:27: warning: 'buf[8]' may be used uninitialized in this function [-Wuninitialized] drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[8]' was declared here drivers/usb/storage/realtek_cr.c:468:43: warning: 'buf[7]' may be used uninitialized in this function [-Wuninitialized] drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[7]' was declared here drivers/usb/storage/realtek_cr.c:467:30: warning: 'buf[6]' may be used uninitialized in this function [-Wuninitialized] drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[6]' was declared here drivers/usb/storage/realtek_cr.c:466:30: warning: 'buf[5]' may be used uninitialized in this function [-Wuninitialized] drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[5]' was declared here drivers/usb/storage/realtek_cr.c:465:28: warning: 'buf[4]' may be used uninitialized in this function [-Wuninitialized] drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[4]' was declared here drivers/usb/storage/realtek_cr.c:464:24: warning: 'buf[3]' may be used uninitialized in this function [-Wuninitialized] drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[3]' was declared here drivers/usb/storage/realtek_cr.c:464:40: warning: 'buf[2]' may be used uninitialized in this function [-Wuninitialized] drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[2]' was declared here drivers/usb/storage/realtek_cr.c:463:24: warning: 'buf[1]' may be used uninitialized in this function [-Wuninitialized] drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[1]' was declared here drivers/usb/storage/realtek_cr.c:463:40: warning: 'buf[0]' may be used uninitialized in this function [-Wuninitialized] drivers/usb/storage/realtek_cr.c:455:5: note: 'buf[0]' was declared here Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30USB: ftdi_sio: use ftdi_get_modem_status in chars_in_bufferJohan Hovold
Use ftdi_get_modem_status to check hardware buffers in chars_in_buffer. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30USB: ftdi_sio: optimise chars_in_bufferJohan Hovold
No need to check hardware buffers when we know that the software buffers are non-empty. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30USB: ftdi_sio: use generic chars_in_bufferJohan Hovold
Use generic chars_in_buffer rather than copying it's implementation. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30USB: serial: export usb_serial_generic_chars_in_bufferJohan Hovold
Export generic chars_in_buffer implementation so it can be used in subdrivers in combination with checks of any hardware buffers. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30USB: ftdi_sio: refactor modem-control status retrievalJohan Hovold
Refactor modem-control status retrieval. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30USB: ftdi_sio: fix tiocmget and tiocmset return valuesJohan Hovold
Make sure we do not return USB-internal error codes to userspace. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30USB: ftdi_sio: fix tiocmget indentationJohan Hovold
Align the modem-control status operands as was originally indented. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30USB: ftdi_sio: remove unused private port-dataJohan Hovold
Remove unused port field from private port data. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30USB: fix build with XEN and EARLY_PRINTK_DBGP enabled but USB_SUPPORT disabledJan Beulich
Since there's no possible caller of dbgp_external_startup() and dbgp_reset_prep() when !USB_EHCI_HCD, there's no point in building and exporting these functions in that case. This eliminates a build error under the conditions listed in the subject, introduced with the merge f1c6872e4980bc4078cfaead05f892b3d78dea64. Reported-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Jan Beulich <jbeulich@suse.com> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30USB: ftdi_sio: remove unnecessary memsetJohan Hovold
No need to memset a kzalloced struct. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30USB: cp210x: fix whitespace issuesJohan Hovold
Fix missing and superfluous whitespace. Fix misplaced brackets. Fix indentation. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30USB: iuu_phoenix: replace strict_strtoul() with kstrtoul()Jingoo Han
The usage of strict_strtoul() is not preferred, because strict_strtoul() is obsolete. Thus, kstrtoul() should be used. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30usb: Convert dev_printk(KERN_<LEVEL> to dev_<level>(Joe Perches
dev_<level> calls take less code than dev_printk(KERN_<LEVEL> and reducing object size is good. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-29Merge 3.7-rc3 into usb-next.Greg Kroah-Hartman
This pulls in all of the USB changes in 3.7-rc3 into usb-next and resolves the merge issue with: drivers/usb/misc/ezusb.c Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25xhci: trivial: Remove assigned but unused ep_ctx.Sarah Sharp
Remove the variable ep_ctx from xhci_add_endpoint(), since it is assigned but unused. Caught by Coverity. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2012-10-25xhci: trivial: Remove assigned but unused slot_ctx.Sarah Sharp
Remove the variable slot_ctx from xhci_dbg_ctx(), since it is assigned but unused. Caught by Coverity. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2012-10-25xhci: Fix missing break in xhci_evaluate_context_result.Sarah Sharp
Coverity complains that xhci_evaluate_context_result() is missing a break statement after the COMP_EBADSLT switch case. It's not a big deal, since we wanted to return the same error code as the case statement below it does. The end result would be one that a Slot Disabled error completion code would also print the warning message associated with a Context State error code. No other bad behavior would result. It's not worth backporting to stable kernels, since it only fixes an issue with too much debugging. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2012-10-25xhci: Fix potential NULL ptr deref in command cancellation.Sarah Sharp
The command cancellation code doesn't check whether find_trb_seg() couldn't find the segment that contains the TRB to be canceled. This could cause a NULL pointer deference later in the function when next_trb is called. It's unlikely to happen unless something is wrong with the command ring pointers, so add some debugging in case it happens. This patch should be backported to stable kernels as old as 3.0, that contain the commit b63f4053cc8aa22a98e3f9a97845afe6c15d0a0d "xHCI: handle command after aborting the command ring". Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Cc: stable@vger.kernel.org
2012-10-25USB: isp1760-if: Change to use irq_of_parse_and_mapNobuhiro Iwamatsu
This uses irq_of_parse_and_map instead of of_irq_map_one and irq_create_of_mapping. Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25USB: set hub's default autosuspend delay as 0Ming Lei
This patch sets hub device's default autosuspend delay as 0 to speedup bus suspend, see comments in code for details. Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Ming Lei <ming.lei@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25USB: check port changes before hub runtime suspend for some bug deviceMing Lei
The hub status endpoint has a long 'bInterval', which is 255ms for FS/LS device and 256ms for HS device according to USB 2.0 spec, so the device connection change may be reported later more than 255ms via status pipe. The connection change in hub may have been happened already on the downstream ports, but no status URB completes when it is killed in hub_suspend(auto), so the connection change may be missed by some buggy hub devices, which won't generate remote wakeup signal after their remote wakeup is enabled and they are put into suspend state. The problem can be observed at least on the below Genesys Logic, Inc. hub devices: 0x05e3,0x0606 0x05e3,0x0608 In theory, there is no way to fix the problem completely, but we can make it less likely to occur by this patch. This patch introduces one quirk of HUB_QUIRK_CHECK_PORTS_AUTOSUSPEND to check ports' change during hub_suspend(auto) for the buggy devices. If ports' change is found, terminate the auto suspend and return to working state. So for the buggy hubs, if the connection change happend before the ports' check, it can be handled correctly. If it happens between the ports' check and enabling remote wakeup/entering suspend, it will be missed. Considered the interval is quite short, it is very less likely to happen during the window. Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Ming Lei <ming.lei@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25ehci: Add yet-another Lucid nohandoff pci quirkAnisse Astier
Board name changed on another shipping Lucid tablet. Signed-off-by: Anisse Astier <anisse@astier.eu> Cc: <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25ehci: fix Lucid nohandoff pci quirk to be more generic with BIOS versionsAnisse Astier
BIOS vendors keep changing the BIOS versions. Only match the beginning of the string to match all Lucid tablets with board name M11JB. Signed-off-by: Anisse Astier <anisse@astier.eu> Cc: <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25USB: mos7840: fix port_probe flowJohan Hovold
Remove temporary do-while(0) loop used to keep changes minimal. Fixup indentation, remove some line breaks, and replace break with goto to maintain flow. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25USB: mos7840: fix port-data memory leakJohan Hovold
Fix port-data memory leak by moving port data allocation and deallocation to port_probe and port_remove. Since commit 0998d0631001288 (device-core: Ensure drvdata = NULL when no driver is bound) the port private data is no longer freed at release as it is no longer accessible. Note that the indentation was kept intact using a do-while(0) in order to facilitate review. A follow-up patch will remove it. Compile-only tested. Signed-off-by: Johan Hovold <jhovold@gmail.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25USB: mos7840: remove invalid disconnect handlingJohan Hovold
Remove private zombie flag used to signal disconnect and to prevent control urb from being submitted from interrupt urb completion handler. The control urb will not be re-submitted as both the control urb and the interrupt urb is killed on disconnect. Signed-off-by: Johan Hovold <jhovold@gmail.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25USB: mos7840: remove NULL-urb submissionJohan Hovold
The private int_urb is never allocated so the submission from the control completion handler will always fail. Remove this odd piece of broken code. Signed-off-by: Johan Hovold <jhovold@gmail.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25usb: serial: ftdi_sio: Add missing chars_in_buffer functionJarkko Huijts
The driver does not wait until the hardware buffer (for data from the PC to the UART line) is drained when tcdrain or close is called in an application. Solution: Implement a chars_in_buffer function that checks both the software and hardware buffer. If the TEMT (TX empty) bit of the line status register indicates the hw buffer is not empty, let the function return at least 1. This has been verified to work correctly with an FT232RL. The check on the hw buffer can not be done for the original SIO device. Signed-off-by: Jarkko Huijts <jarkko.huijts@gmail.com> Acked-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25USB: qcserial: fix interface-data memory leak in error pathJohan Hovold
Move interface data allocation to attach so that it is deallocated should usb-serial probe fail. Signed-off-by: Johan Hovold <jhovold@gmail.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25USB: option: fix interface-data memory leak in error pathJohan Hovold
Move interface data allocation to attach so that it is deallocated should usb-serial probe fail. Note that the usb device id is stored at probe so that it can be used in attach to determine send-setup blacklisting. Signed-off-by: Johan Hovold <jhovold@gmail.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25USB: ipw: fix interface-data memory leak in error pathJohan Hovold
Move interface data allocation to attach so that it is deallocated should usb-serial probe fail. Signed-off-by: Johan Hovold <jhovold@gmail.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25USB: mos7840: fix port-device leak in error pathJohan Hovold
The driver set the usb-serial port pointers to NULL on errors in attach, effectively preventing usb-serial core from decrementing the port ref counters and releasing the port devices and associated data. Cc: <stable@vger.kernel.org> Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25USB: mos7840: fix urb leak at releaseJohan Hovold
Make sure control urb is freed at release. Cc: <stable@vger.kernel.org> Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25USB: sierra: fix port-data memory leakJohan Hovold
Fix port-data memory leak by moving port data allocation and deallocation to port_probe and port_remove. Since commit 0998d0631001288 (device-core: Ensure drvdata = NULL when no driver is bound) the port private data is no longer freed at release as it is no longer accessible. Note also that urb-count for multi-port interfaces has not been changed even though the usb-serial port number is now determined from the port and interface minor numbers. Compile-only tested. Cc: <stable@vger.kernel.org> Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25USB: sierra: fix memory leak in probe error pathJohan Hovold
Move interface data allocation to attach so that it is deallocated on errors in usb-serial probe. Cc: <stable@vger.kernel.org> Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25USB: sierra: fix memory leak in attach error pathJohan Hovold
Make sure port private data is deallocated on errors in attach. Cc: <stable@vger.kernel.org> Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25USB: usb-wwan: fix multiple memory leaks in error pathsJohan Hovold
Fix port-data memory leak in usb-serial probe error path by moving port data allocation to port_probe. Since commit a1028f0abf ("usb: usb_wwan: replace release and disconnect with a port_remove hook") port data is deallocated in port_remove. This leaves a possibility for memory leaks if usb-serial probe fails after attach but before the port in question has been successfully registered. Note that this patch also fixes two additional memory leaks in the error path of attach should port initialisation fail for any port as the urbs were never freed and neither was the data of any of the successfully initialised ports. Compile-only tested. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25USB: keyspan: fix NULL-pointer dereferences and memory leaksJohan Hovold
Fix NULL-pointer dereference at release by moving port data allocation and deallocation to port_probe and port_remove. Fix NULL-pointer dereference at disconnect by stopping port urbs at port_remove. Since commit 0998d0631001288 (device-core: Ensure drvdata = NULL when no driver is bound) the port private data is no longer accessible at disconnect or release. Note that this patch also fixes port and interface-data memory leaks in the error path of attach should port initialisation fail for any port. Compile-only tested. Cc: <stable@vger.kernel.org> Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25USB: mct_u232: fix broken closeJohan Hovold
Make sure generic close is called at close. The driver relies on the generic write implementation but did not call generic close. Note that the call to kill the read urb is not redundant, as mct_u232 uses an interrupt urb from the second port as the read urb and that generic close therefore fails to kill it. Compile-only tested. Cc: <stable@vger.kernel.org> Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25USB: mct_u232: fix port-data memory leakJohan Hovold
Fix port-data memory leak by moving port data allocation and deallocation to port_probe and port_remove. Since commit 0998d0631001288 (device-core: Ensure drvdata = NULL when no driver is bound) the port private data is no longer freed at release as it is no longer accessible. Note that the write waitqueue was initialised but never used. Compile-only tested. Cc: <stable@vger.kernel.org> Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25USB: opticon: fix memory leak in error pathJohan Hovold
Fix memory leak in write error path. Cc: <stable@vger.kernel.org> Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25USB: opticon: fix DMA from stackJohan Hovold
Make sure to allocate the control-message buffer dynamically as some platforms cannot do DMA from stack. Note that only the first byte of the old buffer was used. Cc: <stable@vger.kernel.org> Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25USB: quatech2: fix io after disconnectJohan Hovold
Make sure no control urb is submitted during close after a disconnect by checking the disconnected flag. Cc: <stable@vger.kernel.org> Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25USB: quatech2: fix close and disconnect urb handlingJohan Hovold
Kill urbs unconditionally at close and disconnect. Note that URB status is not valid outside of completion handler. Cc: <stable@vger.kernel.org> Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25USB: quatech2: fix port-data memory leaksJohan Hovold
Fix port-data memory leak by moving port data allocation and deallocation to port_probe and port_remove. Since commit 0998d0631001288 (device-core: Ensure drvdata = NULL when no driver is bound) the port private data is no longer freed at release as it is no longer accessible. Note that this also fixes memory leaks in the error path of attach where the write urbs were not freed on errors. Make sure all interface-data deallocation is done in release by moving the read urb deallocation from disconnect. Note that the write urb is killed during close so that the call in disconnect was superfluous. Compile-only tested. Cc: Bill Pemberton <wfp5p@virginia.edu> Cc: <stable@vger.kernel.org> Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-25USB: quatech2: fix memory leak in error pathJohan Hovold
Fix memory leak in attach error path where the read urb was never freed. Cc: Bill Pemberton <wfp5p@virginia.edu> Cc: <stable@vger.kernel.org> Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>